php artisan mysql-dump custom_file How to Execute From Code
Closed this issue · 5 comments
MadHack25 commented
in My Function Code Executes:
public function execute(){
Artisan::call('backup:mysql-dump');
My Question is How To Write Code for Executing Command
php artisan mysql-dump custom_file
ibraah88 commented
up
Dewbud commented
You can pass parameters to programic artisan commands by passing an array as the second parameter.
\Artisan::call('backup:mysql-dump', [
'custom_file' => 'for_bar'
]);
https://laravel.com/docs/master/artisan#programmatically-executing-commands
MadHack25 commented
Thank You Guys
it Worked! ))
NazarAli commented
i have same problem try the example and not work
paulvl commented
@NazarAli have you tried the proposed answer from @Dewbud on #21 (comment)