diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 01066db8..07eb4deb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: strategy: matrix: laravel: [ - # "^6.0", + "^6.0", "^7.0" ] diff --git a/src/Database/Models/Domain.php b/src/Database/Models/Domain.php index ad3a2013..7acc1c0a 100644 --- a/src/Database/Models/Domain.php +++ b/src/Database/Models/Domain.php @@ -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()) { diff --git a/src/Database/Models/TenantPivot.php b/src/Database/Models/TenantPivot.php index b28c03fa..6fc08756 100644 --- a/src/Database/Models/TenantPivot.php +++ b/src/Database/Models/TenantPivot.php @@ -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; diff --git a/src/Middleware/CheckTenantForMaintenanceMode.php b/src/Middleware/CheckTenantForMaintenanceMode.php index 1fccdc9d..4e0e4828 100644 --- a/src/Middleware/CheckTenantForMaintenanceMode.php +++ b/src/Middleware/CheckTenantForMaintenanceMode.php @@ -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; diff --git a/tests/ScopeSessionsTest.php b/tests/ScopeSessionsTest.php index 25bcc2eb..72559ad0 100644 --- a/tests/ScopeSessionsTest.php +++ b/tests/ScopeSessionsTest.php @@ -21,7 +21,7 @@ class ScopeSessionsTest extends TestCase 'middleware' => [StartSession::class, InitializeTenancyBySubdomain::class, ScopeSessions::class], ], function () { Route::get('/foo', function () { - return true; + return 'true'; }); });