check(); } /** * Prepare the data for validation. * * @return void */ protected function prepareForValidation(): void { $this->merge([ 'link_new_tab' => $this->link_new_tab ? true : false ]); } /** * Get the validation rules that apply to the request. * * @return array */ public function rules(): array { return [ 'title' => 'required', 'text' => 'required', 'picture' => 'sometimes|image|mimes:jpeg,png,jpg|max:2048|dimensions:width=1920,height=354', 'alt_text_picture' => 'required|max:255', 'link' => 'sometimes|max:255', 'link_label' => 'sometimes|max:255', 'link_new_tab' => 'sometimes|boolean', ]; } }