| Total Complexity | 3 |
| Total Lines | 42 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | class Kernel extends ConsoleKernel |
||
| 12 | { |
||
| 13 | private $date = '2018-03-20'; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * The Artisan commands provided by your application. |
||
| 17 | * |
||
| 18 | * @var array |
||
| 19 | */ |
||
| 20 | protected $commands = [ |
||
| 21 | // |
||
| 22 | ]; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * Define the application's command schedule. |
||
| 26 | * |
||
| 27 | * @param \Illuminate\Console\Scheduling\Schedule $schedule |
||
| 28 | * |
||
| 29 | * @return void |
||
| 30 | */ |
||
| 31 | protected function schedule(Schedule $schedule) |
||
| 32 | { |
||
| 33 | // $schedule->command('inspire') |
||
| 34 | // ->hourly(); |
||
| 35 | |||
| 36 | if (substr(Carbon::now(), 0, 10) === $this->date) { |
||
| 37 | $schedule->call(function () { |
||
| 38 | Mail::to('[email protected]')->send(new HelloUser()); |
||
| 39 | })->at('08:00'); |
||
| 40 | } |
||
| 41 | } |
||
| 42 | |||
| 43 | /** |
||
| 44 | * Register the commands for the application. |
||
| 45 | * |
||
| 46 | * @return void |
||
| 47 | */ |
||
| 48 | protected function commands() |
||
| 53 | } |
||
| 54 | } |
||
| 55 |