valid_till = date("Y-m-d H:i:s", time() + 3600); $user = User::findOrFail($passwordReminder->userEmail); Mail::send('botleagues-api::emails.auth.reminder', ['token' => $passwordReminder->token], function($message) use ($user) { $message->to($user->email, "User " . $user->email); }); }); } public function useToken() { $this->used_at = date('Y-m-d H:i:s'); $this->save(); } public function isValid() { return empty($this->used_at) && strtotime($this->valid_till) > time(); } public function getDates() { return ['created_at']; } public function getUpdatedAtColumn() { return null; } public function setUpdatedAtAttribute() { } }