laravel-backup icon indicating copy to clipboard operation
laravel-backup copied to clipboard

Command responses

Open Corvisier opened this issue 10 years ago • 3 comments

Hi schickling,

Great package, very useful. I have a question though, How can we retrive the status of the command? i.e if the command failed or not? So we an flash a message to the view?

Regards

Corvisier avatar Mar 17 '14 12:03 Corvisier

Hi @Corvisier,

if you look into the source you should find what you were looking for:

https://github.com/schickling/laravel-backup/blob/master/src/Schickling/Backup/Commands/BackupCommand.php#L41

schickling avatar Mar 17 '14 15:03 schickling

Hi @schickling, Thanks for the fast reply. I checked the source code before posting hence the question. I use it like this from the controller:

Artisan::call('db:backup');

I know I need to check for the status so I can display a message that's not the problem. It's just how do I pass $status to my controller? Sorry for the noob question...

Regards

Corvisier avatar Mar 17 '14 15:03 Corvisier

Well, the plugin wasn't built for that purpose. I'm not sure how Artisan::call handles a response status.

schickling avatar Mar 17 '14 15:03 schickling