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 [ 'acceptance_criteria' => ['nullable', 'string'], 'assignee_user_id' => ['nullable', 'integer', Rule::exists('users', 'id')], 'description' => ['nullable', 'string'], 'ticket_priority_id' => [ 'required', 'integer', Rule::exists('ticket_priorities', 'id')->where('project_id', $project->id), ], 'ticket_type_id' => [ 'required', 'integer', Rule::exists('ticket_types', 'id')->where('project_id', $project->id), ], 'story_points' => ['nullable', 'integer', 'min:0'], 'title' => ['required', 'string', 'max:255'], ]; } }