How can I run a php artisan command in the background from controller?

Viewed 3099

I'm trying to figure out a way I can set a artisan command to run in the background when a user does an action, if I run the artisan call method the browser will just load untill it's done.

What I want to do is would similar this to in the terminal:

php artisan fix > /dev/null 2>&1 &

But run it from the controller instead, is that possible?

Btw. I know I could just setup a cronjob to run it, but I really want to run it from the controller.

1 Answers
Related