Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

abdulbasitrana's avatar

How to get Laravel Schedule Last Run Date?

Where Laravel Schedule Last Run Date Save in the File?

0 likes
2 replies
scottHellings88's avatar
Level 1

From the documentation there are task events that you can use https://laravel.com/docs/9.x/scheduling#task-hooks

$schedule->command('emails:send')
         ->daily()
         ->before(function () {
             // The task is about to execute...
         })
         ->after(function () {
             // The task has executed...
         });

You could use the after hook to log to a file or update a value in the database

1 like

Please or to participate in this conversation.