where('username', '=', $this->username)->value('is_online'); } /** * Get the validation rules that apply to the request. * * @return array */ public function rules(): array { return [ 'username' => 'required|exists:users,username', 'password' => 'required|string', ]; } }