mercredi 5 août 2020

How to shedule a time base query? in laravel

im using this query to update a status value

 public function updateStatus(Request $request)
    {
        $customer = Customer::findOrFail($request->user_id);
        $customer->status = $request->status;
        $customer->new_customer_status = 1;
        $customer->save();
        return response()->json(['message' => 'User status updated successfully.']);
    }

i want that if status == 1 then after one week ($customer->new_customer_status) should automaticly "NULL" how i can shedule time based or days dased query that run autumaticly after one week or given time?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire