check(); } /** * Prepare the data for validation. * * @return void */ protected function prepareForValidation() { $this->merge([ 'published' => $this->published ? true : false ]); $this->mergePicture('picture'); } /** * Get the validation rules that apply to the request. * * @return array */ public function rules() { $rules = [ 'title' => 'required|string|min:3|max:255', 'picture_alt' => 'required|string|min:3|max:255', 'picture_title' => 'required|string|min:3|max:255', 'published' => 'required|boolean', ]; return \array_merge( $rules, $this->pictureRules('picture', 185, 185, 185, 185, false), ); } }