guard('contact')->user()->loadMissing(['company']); return auth()->guard('contact')->user()->company->enabled_modules & PortalComposer::MODULE_INVOICES; } public function rules() { return [ 'invoices' => ['array'], ]; } public function prepareForValidation() { $input = $this->all(); if(isset($input['invoices'])) { $input['invoices'] = array_unique($input['invoices']); } $this->replace($input); } }