Hello! I am studying laravel, and would like to know if it is possible to call the artisan commands in the Controllers. Example: When the user clicks the button he executes an artisan command, a routine or something related.
Hello! I am studying laravel, and would like to know if it is possible to call the artisan commands in the Controllers. Example: When the user clicks the button he executes an artisan command, a routine or something related.
Laravel version missing but at least in 5.1 you can use the artisan's facade
use Illuminate\Support\Facades\Artisan;
and within the function:
Artisan::call('down');
In the example I gave Laravel was put into maintenance mode.