Add a withSchedule
method to the ApplicationBuilder
class
#50493
-
I’m exploring Laravel 11. One thing I don’t really like is defining scheduled tasks in a routes/console.php file. I’ve never liked the thought of “routes” for CLI. I see a lot of stuff has been moved to the In my mind, it would look something like this: return Application::configure(basePath: dirname(__DIR__))
// ...
->withSchedule(function (Schedule $schedule) {
$schedule->command('inspire')->hourly();
})
->create(); Thoughts? I’m also happy to put the PR together if this was wanted. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Yeah, I like this idea! 👍 |
Beta Was this translation helpful? Give feedback.
-
@taylorotwell @driesvints Any thoughts on this? Given the number of up-votes this has garnered versus other ideas, it seems I’m not alone in wanting this feature. |
Beta Was this translation helpful? Give feedback.
-
Done here: #50755. It's a great suggestion. |
Beta Was this translation helpful? Give feedback.
Done here: #50755. It's a great suggestion.