check(); } /** * Prepare the data for validation. * * @return void */ protected function prepareForValidation() { $this->merge([ 'status' => $this->status ? true : false ]); } /** * Get the validation rules that apply to the request. * * @return array */ public function rules() { $rules = [ 'name' => 'required|string|min:3|max:255', 'type' => [new Enum(CampaignTypes::class)], 'status' => 'required|boolean', 'brand_id' => 'required|exists:brands,id' ]; return $rules; } }