check(); } /** * Prepare the data for validation. * * @return void */ protected function prepareForValidation() { $this->merge([ 'status' => $this->status ? true : false ]); $this->mergePicture('sticker'); } /** * Get the validation rules that apply to the request. * * @return array */ public function rules() { $rules = [ 'name' => 'required|min:3|max:255', 'sticker_alt' => 'required|min:3|max:255', 'sticker_title' => 'required|min:3|max:255', 'status' => 'required|boolean', ]; return \array_merge( $rules, $this->pictureRules('sticker', 150, 150, 150, 150, true), ); } /** * Get custom attributes for validator errors. * * @return array */ public function attributes() { return [ 'name' => trans('nom'), 'sticker' => trans('vignette'), 'sticker_alt' => trans('attribut alt de la vignette'), 'sticker_title' => trans('titre de la vignette'), 'status' => trans('état de publication'), ]; } }