user() !== null; } /** * Get the validation rules that apply to the request. * * @return array|string> */ public function rules(): array { $workspaceId = $this->session()->get('current_workspace_id'); return [ 'user_id' => [ 'required', 'integer', Rule::exists('workspace_user', 'user_id') ->where('workspace_id', $workspaceId), ], 'message' => ['required', 'string', 'max:500'], ]; } }