【发布时间】:2016-05-20 16:16:13
【问题描述】:
如何在我的 php caode 中使用 Artisan 命令行 例如:php artisan --version 到 <?php echo 'version show here'; ?>。
【问题讨论】:
如何在我的 php caode 中使用 Artisan 命令行 例如:php artisan --version 到 <?php echo 'version show here'; ?>。
【问题讨论】:
您可以从控制器调用 Artisan 命令,如下所示:
//calling of migrate install
Artisan::call('migrate:install');
即只需使用
Artisan::call('Commandname');
更多信息请查看this
【讨论】:
use Illuminate\Support\Facades\Artisan;