我有这样的控制器
public function store(Request $request)
{
Artisan::call("php artisan infyom:scaffold {$request['name']} --fieldsFile=public/Product.json");
}
Show me error
在"php artisan infyom"命名空间中没有定义任何命令.
当我在CMD中运行这个命令时,它可以正常工作
我有这样的控制器
public function store(Request $request)
{
Artisan::call("php artisan infyom:scaffold {$request['name']} --fieldsFile=public/Product.json");
}
Show me error
在"php artisan infyom"命名空间中没有定义任何命令.
当我在CMD中运行这个命令时,它可以正常工作
You need to remove php artisan
part and put parameters into an array to make it work:
public function store(Request $request)
{
Artisan::call("infyom:scaffold", ['name' => $request['name'], '--fieldsFile' => 'public/Product.json']);
}
https://laravel.com/docs/5.2/artisan#calling-commands-via-code