Skip to content

Commit 617b869

Browse files
authored
Update Task Scheduler Docs for Laravel 11 (#475)
1 parent 4250cdd commit 617b869

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

docs/content/docs/4.laravel/2.laravel-task-scheduler.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ services:
4949
This is an example how we would set the actual execution time within Laravel itself:
5050
::code-panel
5151
---
52-
label: Example Laravel `Kernel.php`
52+
label: Example in Laravel (version <= 10) using `Kernel.php`
5353
---
5454
```php
5555
<?php
@@ -97,6 +97,22 @@ class Kernel extends ConsoleKernel
9797
```
9898
::
9999

100+
::code-panel
101+
---
102+
label: Example in Laravel (version >= 11) using `routes/console.php`
103+
---
104+
```php
105+
<?php
106+
107+
use Illuminate\Support\Facades\DB;
108+
use Illuminate\Support\Facades\Schedule;
109+
110+
Schedule::call(function () {
111+
DB::table('recent_users')->delete();
112+
})->daily()->at('04:00')->timezone('America/Chicago');
113+
```
114+
::
115+
100116
## Get Up and Running The Easy Way
101117
We do all the heavy lifting for you with Spin Pro. It's as easy as selecting it in a menu and we'll configure everything else for you. Learn how easy it is to get up and running with the Task Scheduler on Spin Pro.
102118

0 commit comments

Comments
 (0)