Skip to content

Commit efe26cf

Browse files
committed
console kernel not needed... console routes file can define schedule
1 parent 4e8f7d6 commit efe26cf

File tree

2 files changed

+33
-29
lines changed

2 files changed

+33
-29
lines changed

app/Console/Kernel.php

Lines changed: 0 additions & 29 deletions
This file was deleted.

routes/console.php

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php
2+
3+
use Illuminate\Foundation\Inspiring;
4+
use Illuminate\Support\Facades\Artisan;
5+
use Illuminate\Support\Facades\Schedule;
6+
7+
/*
8+
|--------------------------------------------------------------------------
9+
| Console Commands
10+
|--------------------------------------------------------------------------
11+
|
12+
| This file is where you may define all of your Closure based console
13+
| commands. Each Closure is bound to a command instance allowing a
14+
| simple approach to interacting with each command's IO methods.
15+
|
16+
*/
17+
18+
Artisan::command('inspire', function () {
19+
$this->comment(Inspiring::quote());
20+
})->purpose('Display an inspiring quote');
21+
22+
/*
23+
|--------------------------------------------------------------------------
24+
| Console Schedule
25+
|--------------------------------------------------------------------------
26+
|
27+
| Below you may define your scheduled tasks, including console commands
28+
| or system commands. These tasks will be run automatically when due
29+
| using Laravel's built-in "schedule:run" Artisan console command.
30+
|
31+
*/
32+
33+
Schedule::command('inspire')->hourly();

0 commit comments

Comments
 (0)