Re-add Location Observer with null-safe companyable check

This commit is contained in:
Brady Wetherington
2026-03-06 21:43:19 +00:00
parent 45ddaf1b72
commit 2b7ed1f7fa
2 changed files with 2 additions and 2 deletions

View File

@@ -20,7 +20,7 @@ trait CompanyableTrait
if (__CLASS__ != 'App\Models\Location') {
static::addGlobalScope(new CompanyableScope);
} else {
if (Setting::getSettings()->scope_locations_fmcs == 1) {
if (Setting::getSettings()?->scope_locations_fmcs == 1) {
static::addGlobalScope(new CompanyableScope);
}
}

View File

@@ -75,7 +75,7 @@ class AppServiceProvider extends ServiceProvider
Component::observe(ComponentObserver::class);
Consumable::observe(ConsumableObserver::class);
License::observe(LicenseObserver::class);
// Location::observe(LocationObserver::class);
Location::observe(LocationObserver::class);
Maintenance::observe(MaintenanceObserver::class);
Setting::observe(SettingObserver::class);
User::observe(UserObserver::class);