mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 21:34:03 +00:00
drop laravel < 9 support
This commit is contained in:
parent
eca3b79118
commit
89c5029fd6
7 changed files with 20 additions and 32 deletions
|
|
@ -63,14 +63,11 @@ class QueueTenancyBootstrapper implements TenancyBootstrapper
|
|||
static::initializeTenancyForQueue($event->job->payload()['tenant_id'] ?? null);
|
||||
});
|
||||
|
||||
if (version_compare(app()->version(), '8.64', '>=')) {
|
||||
// JobRetryRequested only exists since Laravel 8.64
|
||||
$dispatcher->listen(JobRetryRequested::class, function ($event) use (&$previousTenant) {
|
||||
$previousTenant = tenant();
|
||||
$dispatcher->listen(JobRetryRequested::class, function ($event) use (&$previousTenant) {
|
||||
$previousTenant = tenant();
|
||||
|
||||
static::initializeTenancyForQueue($event->payload()['tenant_id'] ?? null);
|
||||
});
|
||||
}
|
||||
static::initializeTenancyForQueue($event->payload()['tenant_id'] ?? null);
|
||||
});
|
||||
|
||||
// If we're running tests, we make sure to clean up after any artisan('queue:work') calls
|
||||
$revertToPreviousState = function ($event) use (&$previousTenant, $runningTests) {
|
||||
|
|
|
|||
|
|
@ -46,11 +46,7 @@ class PostgreSQLSchemaManager implements TenantDatabaseManager
|
|||
|
||||
public function makeConnectionConfig(array $baseConfig, string $databaseName): array
|
||||
{
|
||||
if (version_compare(app()->version(), '9.0', '>=')) {
|
||||
$baseConfig['search_path'] = $databaseName;
|
||||
} else {
|
||||
$baseConfig['schema'] = $databaseName;
|
||||
}
|
||||
$baseConfig['search_path'] = $databaseName;
|
||||
|
||||
return $baseConfig;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue