php artisan make:scheduler ? #42523
Unanswered
salimkanoun
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there,
First of all a big thanks to Taylor and the community for developing Laravel, i'm really enjoying it.
My question / idea is : Why Job and Scheduler generation follows 2 different path.
For Queue we have the nice php artisan make:job to create a Job class.
For Scheduler it require manual editing of Kernel.php
Did you already considered to make a "Schedule" folder in which all classes will be registered for the scheduler ?
A scheduled class could inherit of a base schedule class, eventually an abstract class that will force to define an "Every" property (day, week, hour...) or method and an "__invoke" method.
I think the benefit of this would be to be able to create more complex scheduler such as dynamically choosing the output based on some class based custom logic and dividing each scheduler in a separate file might be more readable when you have a lot of scheduler running (also for container building it would be easier to ship different flavor of an app with different scheduler by adding or removing file in the "schedule" folder rather then redefining the whole Kernel.php) .
Best Regards,
Salim
Beta Was this translation helpful? Give feedback.
All reactions