mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-06 10:34:04 +00:00
Fix styling
This commit is contained in:
parent
f498daacc2
commit
c9ab5c4f1d
19 changed files with 62 additions and 51 deletions
|
|
@ -69,7 +69,7 @@ class FilesystemTenancyBootstrapper implements TenancyBootstrapper
|
|||
|
||||
if (! $finalPrefix) {
|
||||
$finalPrefix = $originalRoot
|
||||
? rtrim($originalRoot, '/') . '/'. $suffix
|
||||
? rtrim($originalRoot, '/') . '/' . $suffix
|
||||
: $suffix;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,18 +4,17 @@ declare(strict_types=1);
|
|||
|
||||
namespace Stancl\Tenancy\Bootstrappers;
|
||||
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Config\Repository;
|
||||
use Illuminate\Queue\QueueManager;
|
||||
use Stancl\Tenancy\Contracts\Tenant;
|
||||
use Illuminate\Contracts\Events\Dispatcher;
|
||||
use Illuminate\Contracts\Foundation\Application;
|
||||
use Illuminate\Queue\Events\JobFailed;
|
||||
use Illuminate\Queue\Events\JobProcessed;
|
||||
use Illuminate\Queue\Events\JobProcessing;
|
||||
use Illuminate\Contracts\Events\Dispatcher;
|
||||
use Illuminate\Queue\Events\JobRetryRequested;
|
||||
use Illuminate\Queue\QueueManager;
|
||||
use Illuminate\Support\Testing\Fakes\QueueFake;
|
||||
use Illuminate\Contracts\Foundation\Application;
|
||||
use Stancl\Tenancy\Contracts\TenancyBootstrapper;
|
||||
use Stancl\Tenancy\Contracts\Tenant;
|
||||
|
||||
class QueueTenancyBootstrapper implements TenancyBootstrapper
|
||||
{
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ class CacheManager extends BaseCacheManager
|
|||
|
||||
if ($method === 'tags') {
|
||||
$count = count($parameters);
|
||||
|
||||
|
||||
if ($count !== 1) {
|
||||
throw new \Exception("Method tags() takes exactly 1 argument. $count passed.");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,10 +21,9 @@ class TenantDump extends DumpCommand
|
|||
$this->specifyParameters();
|
||||
}
|
||||
|
||||
|
||||
public function handle(ConnectionResolverInterface $connections, Dispatcher $dispatcher): int
|
||||
{
|
||||
$this->tenant()->run(fn() => parent::handle($connections, $dispatcher));
|
||||
$this->tenant()->run(fn () => parent::handle($connections, $dispatcher));
|
||||
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Stancl\Tenancy\Concerns;
|
||||
|
||||
trait ExtendsLaravelCommand
|
||||
|
|
|
|||
|
|
@ -22,10 +22,15 @@ class ImpersonationToken extends Model
|
|||
use CentralConnection;
|
||||
|
||||
protected $guarded = [];
|
||||
|
||||
public $timestamps = false;
|
||||
|
||||
protected $primaryKey = 'token';
|
||||
|
||||
public $incrementing = false;
|
||||
|
||||
protected $table = 'tenant_user_impersonation_tokens';
|
||||
|
||||
protected $dates = [
|
||||
'created_at',
|
||||
];
|
||||
|
|
|
|||
|
|
@ -29,7 +29,9 @@ class Tenant extends Model implements Contracts\Tenant
|
|||
Concerns\InvalidatesResolverCache;
|
||||
|
||||
protected $table = 'tenants';
|
||||
|
||||
protected $primaryKey = 'id';
|
||||
|
||||
protected $guarded = [];
|
||||
|
||||
public function getTenantKeyName(): string
|
||||
|
|
|
|||
|
|
@ -48,8 +48,7 @@ class UpdateSyncedResource extends QueueableListener
|
|||
protected function updateResourceInCentralDatabaseAndGetTenants($event, $syncedAttributes)
|
||||
{
|
||||
/** @var Model|SyncMaster $centralModel */
|
||||
$centralModel = $event->model->getCentralModelName()
|
||||
::where($event->model->getGlobalIdentifierKeyName(), $event->model->getGlobalIdentifierKey())
|
||||
$centralModel = $event->model->getCentralModelName()::where($event->model->getGlobalIdentifierKeyName(), $event->model->getGlobalIdentifierKey())
|
||||
->first();
|
||||
|
||||
// We disable events for this call, to avoid triggering this event & listener again.
|
||||
|
|
|
|||
|
|
@ -5,10 +5,10 @@ declare(strict_types=1);
|
|||
namespace Stancl\Tenancy\Middleware;
|
||||
|
||||
use Closure;
|
||||
use Symfony\Component\HttpKernel\Exception\HttpException;
|
||||
use Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode;
|
||||
use Stancl\Tenancy\Exceptions\TenancyNotInitializedException;
|
||||
use Symfony\Component\HttpFoundation\IpUtils;
|
||||
use Symfony\Component\HttpKernel\Exception\HttpException;
|
||||
|
||||
class CheckTenantForMaintenanceMode extends CheckForMaintenanceMode
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue