1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-13 00:14:04 +00:00

Laravel 6 support

This commit is contained in:
Samuel Štancl 2020-05-22 10:56:02 +02:00
parent d23dbf18ce
commit 0049a48383
5 changed files with 9 additions and 5 deletions

View file

@ -21,8 +21,10 @@ class Domain extends Model implements Contracts\Domain
protected $guarded = [];
public static function booted()
public static function boot()
{
parent::boot();
$ensureDomainIsNotOccupied = function (Domain $self) {
if ($domain = Domain::where('domain', $self->domain)->first()) {
if ($domain->getKey() !== $self->getKey()) {

View file

@ -7,8 +7,10 @@ use Stancl\Tenancy\Contracts\Syncable;
class TenantPivot extends Pivot
{
public static function booted()
public static function boot()
{
parent::boot();
static::saved(function (self $pivot) {
$parent = $pivot->pivotParent;

View file

@ -11,7 +11,7 @@ use Symfony\Component\HttpFoundation\IpUtils;
class CheckTenantForMaintenanceMode extends CheckForMaintenanceMode
{
public function handle(Request $request, Closure $next)
public function handle($request, Closure $next)
{
if (! tenant()) {
throw new TenancyNotInitializedException;