diff --git a/scheduling.md b/scheduling.md index 147547f76c0..ec35a5bc564 100644 --- a/scheduling.md +++ b/scheduling.md @@ -43,6 +43,14 @@ In addition to scheduling using closures, you may also schedule [invokable objec Schedule::call(new DeleteRecentUsers)->daily(); +If you prefer to reserve your `routes/console.php` file for command definitions only, you may use the `withSchedule` method in your application's `bootstrap/app.php` file to define your scheduled tasks. This method accepts a closure that receives an instance of the scheduler: + + use Illuminate\Console\Scheduling\Schedule; + + ->withSchedule(function (Schedule $schedule) { + $schedule->call(new DeleteRecentUsers)->daily(); + }) + If you would like to view an overview of your scheduled tasks and the next time they are scheduled to run, you may use the `schedule:list` Artisan command: ```bash