user() !== null; } /** * Get the validation rules that apply to the request. * * @return array|string> */ public function rules(): array { return [ 'section' => ['required', Rule::enum(ProjectSettingsSection::class)], ]; } protected function prepareForValidation(): void { $section = Arr::get($this->query(), 'section'); $this->merge([ 'section' => is_string($section) && ProjectSettingsSection::tryFrom($section) !== null ? $section : ProjectSettingsSection::General->value, ]); } }