Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I echo the version of the current Laravel version in php using the view?

I don't want to check my Laravel version in the command prompt (php artisan --version), but in the view itself.

Like this:

<?php   $laravel_version = /*laravel version check code*/; ?> 

In the view:

{{ $laravel_version }} 

Do anyone know how I can do that? Maybe it isn't possible..?

like image 428
Dirk Jan Avatar asked Nov 26 '14 16:11

Dirk Jan


People also ask

What is the latest version of Laravel?

The latest Laravel version is version 9, which was released on February 8, 2022.

How do you check if I have Laravel installed?

Open the command line terminal on your system. Navigate to your Laravel application directory. Then execute the following PHP artisan command to check the Laravel version. The above output shows that you are running Laravel Framework 7.17.

How to check Laravel version in PHP?

1. Command to find Laravel Version. Artisan is a powerful command-line interface included with the Laravel. Open command line terminal on your system. Navigate to your Laravel application directory. Then execute the following PHP artisan command to check the Laravel version. php artisan --version Laravel Framework 7.17.2.

How to check Laravel version using artisan?

Artisan is a powerful command-line interface included with Laravel. Open the command line terminal on your system. Navigate to your Laravel application directory. Then execute the following PHP artisan command to check the Laravel version. The above output shows that you are running Laravel Framework 7.17.2.

How to view current Laravel version through blade templates?

View current Laravel version through Blade Templates, there are many ways: Also, the Laravel version installed can be checked in the command line using the following command : Artisan -Artisan is the name of the command-line interface included with Laravel. It provides a number of helpful commands for your use while developing your application.

How to check PHP version using the command line?

Check PHP Version Using the Command Line (Windows, Linux and macOS) 1. Type the PHP command: php -v 2. The php -v command works on Linux, macOS, Windows, and other supported systems. Its output contains the PHP version...


2 Answers

This is the way how to see laravel version in command explorer:

php artisan --version 
like image 197
Ye Htun Z Avatar answered Sep 25 '22 15:09

Ye Htun Z


$laravel = app(); $version = $laravel::VERSION; 
like image 27
fire Avatar answered Sep 22 '22 15:09

fire