🎨 Tente d'ajouter le rappel journalier
This commit is contained in:
@@ -2,8 +2,12 @@
|
||||
|
||||
namespace App\Console;
|
||||
|
||||
use App\Jobs\SendReminderEmail;
|
||||
use App\Jobs\SendWelcomeEmail;
|
||||
use App\User;
|
||||
use Illuminate\Console\Scheduling\Schedule;
|
||||
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
||||
use Illuminate\Support\Carbon;
|
||||
|
||||
class Kernel extends ConsoleKernel
|
||||
{
|
||||
@@ -24,6 +28,15 @@ class Kernel extends ConsoleKernel
|
||||
*/
|
||||
protected function schedule(Schedule $schedule)
|
||||
{
|
||||
$schedule->call(function() {
|
||||
$users = User::where('email_verified_at', '!=', null)
|
||||
->where('notification_hour', '!=', null)
|
||||
->get();
|
||||
var_dump(count($users));
|
||||
foreach ($users as $user) {
|
||||
dispatch((new SendReminderEmail($user)));
|
||||
}
|
||||
})->everyMinute();
|
||||
// $schedule->command('inspire')
|
||||
// ->hourly();
|
||||
}
|
||||
|
Reference in New Issue
Block a user