check(); } /** * Prepare the data for validation. * * @return void */ protected function prepareForValidation(): void { $this->merge([ 'slug' => Str::slug(strip_tags($this->input('label'))), 'status' => $this->boolean('status'), ]); } /** * Get the validation rules that apply to the request. * * @return array */ public function rules(): array { return [ 'seo_title' => 'required|min:3|max:70', 'seo_description' => 'required|min:50|max:160', 'label' => 'required|min:3|max:255', 'slug' => 'unique_translation:ranges', 'picto' => [new Enum(PictoEnum::class)], 'status' => 'required|boolean' ]; } /** * Get custom attributes for validator errors. * * @return array */ public function attributes(): array { return [ 'seo_title' => trans('title') . ' seo', 'seo_description' => trans('description') . ' seo', 'label' => trans('label'), 'picto' => trans('picto'), 'slug' => trans('slug'), 'status' => trans('publish') ]; } }