*/ public array $bindings = [ CustomerRepository::class => EloquentCustomerRepository::class, CustomerQueries::class => EloquentCustomerQueries::class, CustomerContactRepository::class => EloquentCustomerContactRepository::class, BillingUnitRepository::class => EloquentBillingUnitRepository::class, ]; public function boot(): void { $presentationPath = dirname(__DIR__, 2).'/Presentation'; Livewire::addNamespace('customers', viewPath: $presentationPath.'/Livewire'); if (! $this->app->routesAreCached()) { $this->loadRoutesFrom($presentationPath.'/Routes/web.php'); } // Subcontractors see only the customer jobs assigned to them, not the customer register. Gate::define('customers.use', fn (User $user): bool => $user->role !== Role::Subcontractor); // A consumer's personal identity code is sensitive personal data: only // admins and management (who make the invoices) see it in full or remove it. Gate::define( 'customers.view-personal-identity-code', fn (User $user): bool => in_array($user->role, [Role::Admin, Role::Management], true), ); } }