remember($this->cache_key . $user->id, 1, function () use ($user) { return CustomerLog::query()->where('user_id', $user->id)->orderByDesc('updated_at')->first(); }); return (int)$user->id === (int)$customerLog->user_id && $customerLog->id == $lastOne->id; } public function destroy(User $user, CustomerLog $customerLog) { return (int)$user->id === (int)$customerLog->user_id; } }