for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace App\Console;
use App\Mail\HelloUser;
use App\Mail\ScheduledMail;
use App\User;
use Carbon\Carbon;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
use Illuminate\Support\Facades\Mail;
class Kernel extends ConsoleKernel
{
/**
* The Artisan commands provided by your application.
*
* @var array
*/
protected $commands = [
//
];
* Define the application's command schedule.
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
protected function schedule(Schedule $schedule)
$now = Carbon::now()->toDateTimeString();
$dateSendEmail = Carbon::create(2018, 03, 20)->toDateTimeString();
if($now === $dateSendEmail){
$schedule->call(function () {
Mail::to('[email protected]')->send(new ScheduledMail());
})->at('16:05');
}
* Register the commands for the application.
protected function commands()
$this->load(__DIR__.'/Commands');
require base_path('routes/console.php');