where('telephone_id', '=', $this->telephone_id)->first(); if ($user && $user->is_online === 1) { return false; } $user->update(['telephone_id' => null]); return true; } /** * Get the validation rules that apply to the request. * * @return array */ public function rules(): array { return [ 'username' => 'required|exists:users,username', 'password' => 'required|string', 'telephone_id' => 'required|string' ]; } }