Move observeTenancyModelCreation() to ServiceProvider::boot()`

Registering the tenancy observer in `register()` instead of `boot()` will prevent packages configuring models via a config option, because it runs before the config is booted.
This commit is contained in:
Dennis Koch
2025-08-19 12:49:50 +02:00
parent 8c00e0b160
commit 63d0834a84
+1 -4
View File
@@ -68,10 +68,6 @@ class Panel extends Component
public function register(): void
{
foreach ($this->getResources() as $resource) {
$resource::observeTenancyModelCreation($this);
}
$this->registerLivewireComponents();
$this->registerLivewirePersistentMiddleware();
@@ -88,6 +84,7 @@ class Panel extends Component
public function boot(): void
{
foreach ($this->getResources() as $resource) {
$resource::observeTenancyModelCreation($this);
$resource::registerTenancyModelGlobalScope($this);
}