check(); } /** * Prepare the data for validation. * * @return void */ protected function prepareForValidation() { $this->bannerWidth = config('theme.models.static_pages.banner_maxwidth', $this->bannerWidth); $this->bannerHeight = config('theme.models.static_pages.banner_maxheight', $this->bannerHeight); $this->mergePicture('banner'); } /** * Get the validation rules that apply to the request. * * @return array */ public function rules() { return \array_merge([ 'title' => 'required|string|min:3|max:255', 'value' => 'required|string' ], $this->pictureRules( 'banner', $this->bannerWidth, $this->bannerHeight, $this->bannerWidth, $this->bannerHeight, true )); } /** * Get custom attributes for validator errors. * * @return array */ public function attributes() { return [ 'title' => trans('titre'), 'banner' => trans('image bannière'), 'value' => trans('contenu'), ]; } }