Expand schedule.

This commit is contained in:
James Cole
2018-06-24 13:23:08 +02:00
parent 0b9be029ac
commit 72cca5ccbf

View File

@@ -32,7 +32,7 @@ use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel; use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
/** /**
* File to make sure commnds work. * File to make sure commands work.
*/ */
class Kernel extends ConsoleKernel class Kernel extends ConsoleKernel
{ {
@@ -48,7 +48,7 @@ class Kernel extends ConsoleKernel
/** /**
* Register the commands for the application. * Register the commands for the application.
*/ */
protected function commands() protected function commands(): void
{ {
$this->load(__DIR__ . '/Commands'); $this->load(__DIR__ . '/Commands');
@@ -59,8 +59,6 @@ class Kernel extends ConsoleKernel
* Define the application's command schedule. * Define the application's command schedule.
* *
* @param \Illuminate\Console\Scheduling\Schedule $schedule * @param \Illuminate\Console\Scheduling\Schedule $schedule
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/ */
protected function schedule(Schedule $schedule): void protected function schedule(Schedule $schedule): void
{ {
@@ -76,5 +74,15 @@ class Kernel extends ConsoleKernel
event(new AdminRequestedTestMessage($user, $ipAddress)); event(new AdminRequestedTestMessage($user, $ipAddress));
} }
)->daily(); )->daily();
// send test email.
$schedule->call(
function () {
$ipAddress = '127.0.0.2';
/** @var User $user */
$user = User::find(1);
event(new AdminRequestedTestMessage($user, $ipAddress));
}
)->hourly();
} }
} }