Every now and then you would like to check what version of Laravel do you have installed. How to determine that? Here are a couple of ways. I tested this for Laravel 4.
1. The easiest way is to simply run artisan command php artisan --version
from your CLI and it will return your Laravel version:
2. You can also browse to and open file vendor\laravel\framework\src\Illuminate\Foundation\Application.php
. You will see the version of your Laravel instalation near the top of the class, defined as a constant:
/** * The Laravel framework version. * * @var string */ const VERSION = '4.0.10';
3. You can also place a little code in your routes.php
file at the end and then access it like yourdomain.com/laravel-version
. This of course assumes that there is nothing in your routes.php file that would not allow the access of /laravel-version route.
Route::get('laravel-version', function() { $laravel = app(); return "Your Laravel version is ".$laravel::VERSION; });
Please keep in mind that it is best not to keep this code on your production server. It’s not that it is harmful but there is simply no need for this because the first two methods that I showed you are simpler. If you still want to keep it then maybe you can comment it out.
There are other ways, especially with code but why complicate things when these 3 are the easiest? 🙂
If you know some simpler ways then please let me know in the comments.