Let's say I have a long-lived process to run "Backup Database 1"
I want that to run in every night. (and see result in log)
Also, I want to run it manually sometimes via Artisan Command. (see result in command line)
Also, I need an html button to run it in my HTML Interface. (see result in screen)
What's the best approach?
- Should a Job call the Artisan Command?
- Should an Artisan Command call a Job?
- Should both call a third Class?
- Should the html button call a Job and then output the log file?
Notes:
Laravel documentation says you can execute commands in the queue, adding more confusion.
I tried the example, but the --queue option is not automatically implemented
https://laravel.com/docs/5.6/artisan#programmatically-executing-commands
Artisan::queue('email:send', [
'user' => 1, '--queue' => 'default'
]);