| Total Complexity | 3 |
| Total Lines | 44 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | class Kernel extends ConsoleKernel |
||
| 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 | |||
| 34 | $now = Carbon::now()->toDateTimeString(); |
||
| 35 | $dateSendEmail = Carbon::create(2018, 03, 20)->toDateTimeString(); |
||
| 36 | |||
| 37 | if($now === $dateSendEmail){ |
||
| 38 | |||
| 39 | $schedule->call(function () { |
||
| 40 | Mail::to('[email protected]')->send(new ScheduledMail()); |
||
| 41 | Mail::to('[email protected]')->send(new ScheduledMail()); |
||
| 42 | |||
| 43 | })->at('16:05'); |
||
| 44 | } |
||
| 45 | } |
||
| 46 | |||
| 47 | /** |
||
| 48 | * Register the commands for the application. |
||
| 49 | * |
||
| 50 | * @return void |
||
| 51 | */ |
||
| 52 | protected function commands() |
||
| 57 | } |
||
| 58 | } |
||
| 59 |