check(); } /** * Prepare the data for validation. * * @return void */ protected function prepareForValidation(): void { $this->merge([ 'published' => $this->boolean('published') ]); $this->mergePicture('picture'); } /** * Get the validation rules that apply to the request. * * @return array|string> */ public function rules(): array { $rules = [ 'name' => 'required|string|between:3,255', 'title' => 'required|string|between:3,255', 'text' => [ 'required', 'string', new WysiwygLength(3, 500), ], 'picture_alt' => 'required|string|between:3,255', 'picture_title' => 'required|string|between:3,255', 'network_id' => 'required|exists:networks,id', 'published' => 'required|boolean', ]; return \array_merge( $rules, $this->pictureRules('picture', 1400, 450, 1400, 450, false), ); } }