user()->isAdmin(); } public function rules() { $this->sanitize(); $rules = [ 'fees_and_limits' => new ValidCompanyGatewayFeesAndLimitsRule(), ]; return $rules; } public function sanitize() { $input = $this->all(); $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(); } }