merge([ 'published' => $this->boolean('published'), ]); $this->mergePicture('picture'); } /** * Get the validation rules that apply to the request. */ public function rules(): array { $rules = [ 'label' => 'required|string|between:3,255', 'subtitle' => 'required|string|between:3,255', 'description' => 'required|string|min:3', 'picture_alt' => 'required_with:picture|nullable|between:3,255', 'picture_title' => 'required_with:picture|nullable|between:3,255', 'range_id' => 'required|exists:ranges,id', 'published' => 'required|boolean', ]; return \array_merge( $rules, $this->pictureRules('picture', 720, 405, 720, 405), ); } /** * Get custom attributes for validator errors. */ public function attributes(): array { return [ 'label' => trans('validation.custom.label'), 'subtitle' => trans('validation.custom.subtitle'), 'description' => trans('validation.attributes.description'), 'picture' => trans('validation.attributes.image'), 'picture_alt' => trans('validation.custom.attribute_alt'), 'picture_title' => trans('validation.custom.attribute_title'), 'range_id' => trans('models.classes.range'), 'published' => trans('validation.custom.publication'), ]; } }