check(); } /** * Prepare the data for validation. * * @return void */ public function prepareForValidation(): void { if ( \in_array($this->route('static_page')->type, [ \App\Enums\StaticPageType::confidentiality, \App\Enums\StaticPageType::legals ]) ) { $this->merge([ 'content' => (string)Str::of($this->post('content')) ]); } else { $this->merge([ 'content' => '' ]); } } /** * Get the validation rules that apply to the request. * * @return array|string> */ public function rules(): array { return [ 'seo_title' => 'required|min:45|max:70', 'seo_description' => 'required|min:50|max:160', 'title' => 'required|min:3|max:255', 'content' => 'present', ]; } }