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

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



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire