In this trick you will see how to run artisan command from laravel controller
In routes/web.php
Route::get('/run-artisan-command-xyz','MyController@runArtisanCommand');
In your Controller
public function runArtisanCommand(){
\Artisan::call('command:name', ['--option' => 'foo']);
}
This post is submitted by one of our members. You may submit a new post here.
Laravel interview Questions © 2019 - Designed by PSD to HTML