mirror of
https://github.com/filamentphp/filament.git
synced 2026-09-24 15:42:09 +08:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user