why my cron job is not working in laravel?

in db i have column visit_clear i want it 0 after one day so i used this code in kernal.php

protected function schedule(Schedule $schedule)
{
$schedule->command('cron:update-user-not-new')->daily();
}

and in command/UpdateUserNotNew.php

public function handle()
{
$dayAgo = 1; // Days ago
$dayToCheck = \Carbon\Carbon::now()->subDays($dayAgo)->format('Y-m-d');
Customer::whereDate('visit_date', '<=', $dayToCheck)
->update([
'visit_clear' => 0
]);
}

i am sheduling commnd like this as u can see cron:update-user-not-new should i use crone:UpdateUserNotNew?



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/3825lBr
via IFTTT

تعليقات

المشاركات الشائعة من هذه المدونة

I am unable to figure out how to create payment collection request, after a form has been submitted in laravel

laravel, mysql transaction not working after failed one time