1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-05 21:14:03 +00:00

Apply fixes from StyleCI

This commit is contained in:
stancl 2020-05-22 09:01:31 +00:00 committed by StyleCI Bot
parent 1798ca9c85
commit 6955512a6b
133 changed files with 379 additions and 203 deletions

View file

@ -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);
}