merge([ 'published' => $this->boolean('published'), 'is_on_homepage' => $this->boolean('is_on_homepage'), ]); } /** * Get the validation rules that apply to the request. */ public function rules(): array { return [ 'title' => 'required|string|between:3,255', 'video_id' => 'required|string|between:3,255', 'product_id' => 'sometimes|nullable|integer|exists:products,id', 'is_on_homepage' => 'required|boolean', 'published' => 'required|boolean', ]; } /** * Get custom attributes for validator errors. */ public function attributes(): array { return [ 'title' => trans('validation.attributes.title'), 'video_id' => trans('validation.custom.video_id'), 'is_on_homepage' => trans('validation.custom.on_homepage'), 'published' => trans('validation.custom.published'), ]; } }