merge([ 'type' => intval($this->route()->parameter('approach_type')), 'published' => $this->boolean('published') ]); $this->mergePicture('picture'); } /** * Get the validation rules that apply to the request. * * @return array */ public function rules(): array { $rules = [ 'type' => 'required|numeric|between:0,1', 'name' => 'required|string|between:3,255', 'picture_alt' => 'required_with:picture|nullable|between:3,255', 'picture_title' => 'required_with:picture|nullable|between:3,255', 'published' => 'required|boolean', ]; return \array_merge( $rules, $this->pictureRules('picture', 150, 150, 150, 150), ); } /** * Get custom attributes for validator errors. * * @return array */ public function attributes(): array { return [ 'name' => trans('validation.attributes.name'), 'picture' => trans('validation.attributes.image'), 'picture_alt' => trans('validation.custom.attribute_alt'), 'picture_title' => trans('validation.custom.attribute_title'), 'published' => trans('validation.attributes.published') ]; } }