lundi 12 octobre 2020

how to apply crone job in seconds in Php?

i am updating a user db value in days how to apply it in seconds here is my days code after 7 days each customer's visit_clear set to 0 i want it shoud set 0 after 10 seconds how i can do it?

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

this code is in console in laravel



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

Aucun commentaire:

Enregistrer un commentaire