registerFortifyResponses(); } /** * Swap Fortify's registration response for one that starts checkout for the * plan the account signed up with. */ protected function registerFortifyResponses(): void { $this->app->singleton( RegisterResponseContract::class, RegisterResponse::class, ); } /** * Bootstrap any application services. */ public function boot(): void { $this->configureDefaults(); $this->configureCashier(); $this->defineGates(); } /** * Define the site-wide administrator ability. This is deliberately separate * from an organization's Owner/Admin roles, which only ever grant rights * inside a single workspace. */ protected function defineGates(): void { Gate::define('accessAdmin', fn (User $user): bool => $user->isSiteAdmin()); } /** * Make organizations, rather than users, the Stripe customer. This also * determines the foreign key Cashier uses on the subscriptions table. */ protected function configureCashier(): void { Cashier::useCustomerModel(Organization::class); } /** * Configure default behaviors for production-ready applications. */ protected function configureDefaults(): void { Date::use(CarbonImmutable::class); DB::prohibitDestructiveCommands( app()->isProduction(), ); Password::defaults(fn (): ?Password => app()->isProduction() ? Password::min(12) ->mixedCase() ->letters() ->numbers() ->symbols() ->uncompromised() : null, ); } }