mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-13 04:04:04 +00:00
Merge branch 'master' into cache-prefix
This commit is contained in:
commit
249fc545d2
22 changed files with 564 additions and 38 deletions
|
|
@ -4,14 +4,14 @@ declare(strict_types=1);
|
|||
|
||||
namespace App\Providers;
|
||||
|
||||
use Stancl\Tenancy\Jobs;
|
||||
use Stancl\Tenancy\Events;
|
||||
use Stancl\Tenancy\Listeners;
|
||||
use Stancl\Tenancy\Middleware;
|
||||
use Stancl\JobPipeline\JobPipeline;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Stancl\JobPipeline\JobPipeline;
|
||||
use Stancl\Tenancy\Events;
|
||||
use Stancl\Tenancy\Jobs;
|
||||
use Stancl\Tenancy\Listeners;
|
||||
use Stancl\Tenancy\Middleware;
|
||||
|
||||
class TenancyServiceProvider extends ServiceProvider
|
||||
{
|
||||
|
|
@ -118,6 +118,21 @@ class TenancyServiceProvider extends ServiceProvider
|
|||
];
|
||||
}
|
||||
|
||||
protected function overrideUrlInTenantContext(): void
|
||||
{
|
||||
/**
|
||||
* Example of CLI tenant URL root override:
|
||||
*
|
||||
* UrlTenancyBootstrapper::$rootUrlOverride = function (Tenant $tenant) {
|
||||
* $baseUrl = url('/');
|
||||
* $scheme = str($baseUrl)->before('://');
|
||||
* $hostname = str($baseUrl)->after($scheme . '://');
|
||||
*
|
||||
* return $scheme . '://' . $tenant->getTenantKey() . '.' . $hostname;
|
||||
*};
|
||||
*/
|
||||
}
|
||||
|
||||
public function register()
|
||||
{
|
||||
//
|
||||
|
|
@ -129,6 +144,7 @@ class TenancyServiceProvider extends ServiceProvider
|
|||
$this->mapRoutes();
|
||||
|
||||
$this->makeTenancyMiddlewareHighestPriority();
|
||||
$this->overrideUrlInTenantContext();
|
||||
}
|
||||
|
||||
protected function bootEvents()
|
||||
|
|
|
|||
|
|
@ -103,6 +103,7 @@ return [
|
|||
Stancl\Tenancy\Bootstrappers\QueueTenancyBootstrapper::class,
|
||||
Stancl\Tenancy\Bootstrappers\BatchTenancyBootstrapper::class,
|
||||
// Stancl\Tenancy\Bootstrappers\PrefixCacheTenancyBootstrapper::class,
|
||||
// Stancl\Tenancy\Bootstrappers\UrlTenancyBootstrapper::class,
|
||||
// Stancl\Tenancy\Bootstrappers\SessionTenancyBootstrapper::class,
|
||||
// Stancl\Tenancy\Bootstrappers\MailTenancyBootstrapper::class, // Queueing mail requires using QueueTenancyBootstrapper with $forceRefresh set to true
|
||||
// Stancl\Tenancy\Bootstrappers\RedisTenancyBootstrapper::class, // Note: phpredis is needed
|
||||
|
|
@ -259,7 +260,7 @@ return [
|
|||
],
|
||||
|
||||
/**
|
||||
* Redis tenancy config. Used by RedisTenancyBoostrapper.
|
||||
* Redis tenancy config. Used by RedisTenancyBootstrapper.
|
||||
*
|
||||
* Note: You need phpredis to use Redis tenancy.
|
||||
*
|
||||
|
|
@ -287,6 +288,7 @@ return [
|
|||
// Stancl\Tenancy\Features\TelescopeTags::class,
|
||||
// Stancl\Tenancy\Features\TenantConfig::class, // https://tenancyforlaravel.com/docs/v3/features/tenant-config
|
||||
// Stancl\Tenancy\Features\CrossDomainRedirect::class, // https://tenancyforlaravel.com/docs/v3/features/cross-domain-redirect
|
||||
// Stancl\Tenancy\Features\ViteBundler::class,
|
||||
],
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue