Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

reload/ redirect after schedule Laravel

Is there a possibility to reload/ redirect after a schedule is run in laravel?

I already tried it with the -> after() method on the schedule, but I can’t get it to work.

$schedule->command('update:request')
            ->everyFiveMinutes()
            ->withoutOverlapping()
            ->after(function (){
                return redirect('/');
            });

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Command-side redirection is not possible. With Event listener, you can take action after the command finishes working. However, since Command is not linked to a page, redirection cannot be performed.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading