merge([ 'published' => $this->boolean('published'), ]); $this->mergePicture('banner'); $this->mergePicture('banner_ambiance'); } /** * Get the validation rules that apply to the request. * * @return array */ public function rules(): array { $rules = [ 'label' => 'required|string|between:3,255', 'description' => 'required|string|min:3', 'banner_alt' => 'required|string|between:3,255', 'banner_title' => 'required|string|between:3,255', 'banner_ambiance_alt' => 'required|string|between:3,255', 'banner_ambiance_title' => 'required|string|between:3,255', 'color' => ['required', new Hex()], 'published' => 'required|boolean', ]; return \array_merge( $rules, $this->pictureRules('banner', 700, 350, 700, 350, false), $this->pictureRules('banner_ambiance', 1440, 420, 1440, 420, false), ); } /** * Get custom attributes for validator errors. * * @return array */ public function attributes(): array { return [ 'label' => trans('validation.custom.label'), 'description' => trans('validation.attributes.description'), 'banner_alt' => trans(':field :inter:field2', [ 'field' => __('validation.custom.attribute_alt'), 'inter' => __('validation.custom.of_the.female'), 'field2' => __('validation.custom.banner'), ]), 'banner_title' => trans(':field :inter:field2', [ 'field' => __('validation.custom.attribute_title'), 'inter' => __('validation.custom.of_the.female'), 'field2' => __('validation.custom.banner'), ]), 'banner_ambiance_alt' => trans(':field :inter:field2', [ 'field' => __('validation.custom.attribute_alt'), 'inter' => __('validation.custom.of_the.female'), 'field2' => __('validation.custom.banner_ambiance'), ]), 'banner_ambiance_title' => trans(':field :inter:field2', [ 'field' => __('validation.custom.attribute_title'), 'inter' => __('validation.custom.of_the.female'), 'field2' => __('validation.custom.banner_ambiance'), ]), 'color' => trans('validation.custom.color'), 'published' => trans('validation.custom.publication') ]; } }