*/ protected $policies = []; /** * Register any authentication / authorization services. * * @return void */ public function boot(): void { Gate::define('isConceptor', function (User $user) { return $user->role === RoleEnum::conceptor; }); Gate::define( 'fo.showProducts', // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClass fn (User|Customer|null $user) => view()->exists('theme::pages.products') and (bool)Product::getCached()->count() ); Gate::define( 'fo.showFaq', // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClass fn (User|Customer|null $user) => view()->exists('theme::pages.faq') and (bool)FaqQuestion::getCached()->count() ); $this->app->auth->provider('crm', function ($app, array $config) { return new CrmUserProvider($app['hash'], $config['model']); }); } }