format('Y-m-d'); $cashClose = CashClose::open()->byDate($today)->first(); if (!$cashClose) { $cashClose = CashClose::create([ 'close_date' => $today, 'income' => 0, 'exit' => 0, 'balance' => 0, 'status' => 'open', 'user_id' => Auth::id(), ]); } return $cashClose; } }