Run artisan command in laravel 5

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

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)