merge([ 'published' => $this->boolean('published') ]); $this->mergePicture('picto'); } /** * Get the validation rules that apply to the request. * * @return array */ public function rules(): array { $rules = [ 'text' => 'required|string|min:3', 'picto_alt' => 'required_with:picto|between:3,255', 'picto_title' => 'required_with:picto|between:3,255', 'source' => 'sometimes|string|nullable|between:3,255', 'published' => 'required|boolean', ]; return \array_merge( $rules, $this->pictureRules('picto', 155, 155, 155, 155), ); } /** * Get custom attributes for validator errors. * * @return array */ public function attributes(): array { return [ 'text' => trans('validation.attributes.text'), 'source' => trans('validation.attributes.text'), 'picto' => trans('validation.attributes.image'), 'picto_alt' => trans('validation.attributes.alt_attribute'), 'picto_title' => trans('validation.attributes.title_attribute'), 'published' => trans('validation.attributes.published') ]; } }