merge([ 'published' => $this->input('published') ? true : false, 'brand_id' => $this->input('brand_id') ?: [], ]); } /** * Get the validation rules that apply to the request. * * @return array */ public function rules(): array { /** @var \App\Models\User $userModel */ $userModel = request()->route()->parameter('user'); return array_merge(parent::rules(), [ 'email' => [ 'required', 'string', 'email:rfc,strict,dns,spoof,filter', 'unique:users,email,' . $userModel->getKey(), ], ]); } }