January 4th, 2023 by Alex Garrett-Smith

How to check a Laravel project's version

Sure, it's pretty simple. But you're going to need check at some point.

If you need to check the version of a Laravel project you're currently working in, you've got two options. Let's take a look.

First up, run the --version flag on Artisan for a simple output of the Laravel version in your project.

php artisan --version

Here's what you'll get:

Laravel Framework 9.43.0

Perfect. If that's all you need, you're done.

There's another command, which alongside the version of Laravel you're running, also gives you some really nice insights into the state of your Laravel project. This command was added a little later in Laravel's life, so hasn't been around too long.

php artisan about

With this command run, you'll get the following output

Environment ...................................................................................................................................
Application Name ................................................................................................................... Codecourse
Laravel Version ........................................................................................................................ 9.43.0
PHP Version ............................................................................................................................ 8.1.12
Composer Version ........................................................................................................................ 2.4.4
Environment ............................................................................................................................. local
Debug Mode ............................................................................................................................ ENABLED
URL ........................................................................................................................... codecourse.test
Maintenance Mode .......................................................................................................................... OFF
 
Cache .........................................................................................................................................
Config ............................................................................................................................. NOT CACHED
Events ............................................................................................................................. NOT CACHED
Routes ............................................................................................................................. NOT CACHED
Views .................................................................................................................................. CACHED
 
Drivers .......................................................................................................................................
Broadcasting .............................................................................................................................. log
Cache ................................................................................................................................... redis
Database ................................................................................................................................ pgsql
Logs ............................................................................................................................ stack / daily
Mail ..................................................................................................................................... smtp
Queue ................................................................................................................................... redis
Scout ............................................................................................................................. meilisearch
Session .................................................................................................................................. file

Nice, loads of useful information about the state of your project!

So, next time you need to know the version of Laravel you're running, either command works nicely – with the about command giving you some additional insights.