mirror of
https://github.com/CachetHQ/Cachet.git
synced 2025-01-17 13:38:20 +01:00
Register the relations morph map
This commit is contained in:
parent
4b9e0141e8
commit
9cd5faaa6b
@ -14,6 +14,7 @@ namespace CachetHQ\Cachet\Foundation\Providers;
|
||||
use AltThree\Bus\Dispatcher;
|
||||
use CachetHQ\Cachet\Bus\Middleware\UseDatabaseTransactions;
|
||||
use CachetHQ\Cachet\Services\Dates\DateFactory;
|
||||
use Illuminate\Database\Eloquent\Relations\Relation;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
@ -42,6 +43,14 @@ class AppServiceProvider extends ServiceProvider
|
||||
Str::macro('canonicalize', function ($url) {
|
||||
return preg_replace('/([^\/])$/', '$1/', $url);
|
||||
});
|
||||
|
||||
Relation::morphMap([
|
||||
'components' => \CachetHQ\Cachet\Models\Component::class,
|
||||
'incidents' => \CachetHQ\Cachet\Models\Incident::class,
|
||||
'metrics' => \CachetHQ\Cachet\Models\Metric::class,
|
||||
'schedules' => \CachetHQ\Cachet\Models\Schedule::class,
|
||||
'subscriber' => \CachetHQ\Cachet\Models\Subscriber::class,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user