environment() !== 'testing') { URL::forceScheme('https'); } Auth::provider('tenant-aware-eloquent', function ($app, array $config) { return new TenantAwareUserProvider($app['hash'], $config['model']); }); Gate::policy(User::class, UserPolicy::class); Gate::policy(License::class, LicensePolicy::class); Gate::policy(Tenant::class, TenantPolicy::class); Gate::define('attach-parent-child', function ($user, $parent, $child) { return (new \App\Policies\ParentChildPolicy)->attach($user, $parent, $child); }); Gate::define('detach-parent-child', function ($user, $parent, $child) { return (new \App\Policies\ParentChildPolicy)->detach($user, $parent, $child); }); } }