Run the wizards team in laravel 5

I have such a controller

public function store(Request $request) { Artisan::call("php artisan infyom:scaffold {$request['name']} --fieldsFile=public/Product.json"); } 

Show me the mistake

There are no commands specified in the php artisan infyom namespace.

When I run this command in CMD, it works correctly

+5
source share
1 answer

You need to remove the php artisan part and put the parameters in 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

+11
source

All Articles