Knowledge

How to check which Laravel version of your app is using

#Laravel

Check which Laravel version your app is running on.

Published by Mark van Eijk on November 16, 2022 · 1 minute read

  1. Command Line using Artisan
  2. Command Line using Composer
  3. Using the app() helper

Command Line using Artisan

If you want to know the exact version of your Laravel app, the easiest and fastest option is using the command line:

php artisan --version

# Example output: Laravel Framework 9.33.0

Command Line using Composer

It's also possible to determine the Laravel version using Composer, because Laravel is (or should be) installed using this package manager. Piping the JSON formatted output of Composer to jq makes the value directly accessible:

composer show laravel/framework --format json | jq '.versions'

# Example output: ["v9.33.0"]

Using the app() helper

Within the application code, you can use the app() helper to discover the current Laravel version:

echo app()->version();

// Example output: 9.33.0

Using the helper, you could show the Laravel version in a Blade template to expose it in a development environment or when a admin needs to have some debug info:

{{ app()->version() }}

Subscribe to our newsletter

Do you want to receive regular updates with fresh and exclusive content to learn more about web development, hosting, security and performance? Subscribe now!

Related articles

How to use different PHP versions with Laravel Valet

Check which Laravel version your app is running on.

Read more →

Disable cookies in Laravel

Check which Laravel version your app is running on.

Read more →