['required', 'string', 'max:255', 'regex:/^[^\/\\\\]+$/'], ]; } protected function prepareForValidation(): void { if ($this->route('name') !== null) { $this->merge(['name' => $this->route('name')]); } } }