mirror of
https://github.com/grokability/snipe-it.git
synced 2026-03-12 17:52:00 +08:00
Re-add Location Observer with null-safe companyable check
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user