/** * Compare whether the entity is current set to active. */ public function isActive() { $fourHours = Carbon::now()->subHour(4); $id = PasswordResetRequest::select('request_id')->where('created_at', '>', $fourHours)->where('request_id', $this->id())->where('used', false)->lists('request_id'); return (bool) $id; }