user() !== null; } /** * Get the validation rules that apply to the request. * * @return array|string> */ public function rules(): array { /** @var Project $project */ $project = $this->route('project'); return [ 'branch_name' => ['required', 'string', 'max:255'], 'repository_connection_id' => [ 'required', 'integer', Rule::exists('repository_connections', 'id')->where( fn ($query) => $query->where('project_id', $project->id), ), ], ]; } }