mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-17 06:24:04 +00:00
Apply fixes from StyleCI
This commit is contained in:
parent
1798ca9c85
commit
6955512a6b
133 changed files with 379 additions and 203 deletions
|
|
@ -1,13 +1,15 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Stancl\Tenancy\Database\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Stancl\Tenancy\Contracts;
|
||||
use Stancl\Tenancy\Contracts\Tenant;
|
||||
use Stancl\Tenancy\Database\Concerns\CentralConnection;
|
||||
use Stancl\Tenancy\Events;
|
||||
use Stancl\Tenancy\Exceptions\DomainOccupiedByOtherTenantException;
|
||||
use Stancl\Tenancy\Contracts;
|
||||
use Stancl\Tenancy\Database\Concerns\CentralConnection;
|
||||
|
||||
/**
|
||||
* @property string $domain
|
||||
|
|
@ -25,8 +27,8 @@ class Domain extends Model implements Contracts\Domain
|
|||
{
|
||||
parent::boot();
|
||||
|
||||
$ensureDomainIsNotOccupied = function (Domain $self) {
|
||||
if ($domain = Domain::where('domain', $self->domain)->first()) {
|
||||
$ensureDomainIsNotOccupied = function (self $self) {
|
||||
if ($domain = self::where('domain', $self->domain)->first()) {
|
||||
if ($domain->getKey() !== $self->getKey()) {
|
||||
throw new DomainOccupiedByOtherTenantException($self->domain);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Stancl\Tenancy\Database\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
|
|
@ -38,4 +40,4 @@ class ImpersonationToken extends Model
|
|||
$model->auth_guard = $model->auth_guard ?? config('auth.defaults.guard');
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,20 +1,22 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Stancl\Tenancy\Database\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Stancl\Tenancy\Events;
|
||||
use Stancl\Tenancy\Contracts;
|
||||
use Stancl\Tenancy\Database\TenantCollection;
|
||||
use Stancl\Tenancy\Database\Concerns;
|
||||
use Stancl\Tenancy\Database\TenantCollection;
|
||||
use Stancl\Tenancy\Events;
|
||||
|
||||
/**
|
||||
* @property string|int $id
|
||||
* @property Carbon $created_at
|
||||
* @property Carbon $updated_at
|
||||
* @property array $data
|
||||
*
|
||||
*
|
||||
* @method TenantCollection all()
|
||||
*/
|
||||
class Tenant extends Model implements Contracts\Tenant
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Stancl\Tenancy\Database\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Relations\Pivot;
|
||||
|
|
@ -19,4 +21,4 @@ class TenantPivot extends Pivot
|
|||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue