laravel使用Application对象直接输出version属性。
<?php namespace App\Http\Controllers; use Illuminate\Http\Request; use App\Http\Requests; use App\User; use Illuminate\Foundation\Application; class TestController extends Controller { public function index() { echo Application::VERSION; exit; } }
文件在扩展文件夹:vendor/laravel/framework/src/Illuminate/Foundation/Application.php