user()->isAdmin(); } public function rules() { $this->sanitize(); $rules = [ 'gateway_key' => 'required', 'fees_and_limits' => new ValidCompanyGatewayFeesAndLimitsRule(), ]; return $rules; } public function sanitize() { $input = $this->all(); if(isset($input['config'])) $input['config'] = encrypt($input['config']); if(isset($input['fees_and_limits'])) $input['fees_and_limits'] = $this->cleanFeesAndLimits($input['fees_and_limits']); $this->replace($input); return $this->all(); } }