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

look4meX's avatar

Run the command after load filament page

What is the best way to execute the command or job example: Artisan::call(Run HealthCheck Command::class);

after every Page load (example \health-check-results)?

I read about this feature: filamentphp.com/docs/3.x/panels/configuration#applying-middleware

but I thought that maybe there is another function (on Page/BasePage class) or Event/Listeners hat I can use.

0 likes
2 replies
look4meX's avatar

Terminable Middleware executes after a request is sent to the browser. I need before. I will give an example:

I use filament + spatie/laravel-health. I have a "\health-check-results" page where I display the results. I need to execute the command: Artisan::call(Run HealthCheck Command::class) when someone tries to open the "\health-check-results" page to display the latest health check results.

Please or to participate in this conversation.