71 lines
1.9 KiB
PHP
71 lines
1.9 KiB
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use App\Models\Asset;
|
|
use App\Models\Dictionaries\Dictionary;
|
|
use App\Models\Dictionaries\DictionaryItem;
|
|
use App\Models\Objects\Field;
|
|
use App\Models\Objects\FieldsGroup;
|
|
use App\Models\Objects\NirObject;
|
|
use App\Models\Objects\ObjectType;
|
|
use App\Models\Pages\Page;
|
|
use App\Models\Permission;
|
|
use App\Models\Publications\Publication;
|
|
use App\Models\Registries\Category;
|
|
use App\Models\Registries\Entry;
|
|
use App\Models\Registries\Registry;
|
|
use App\Models\Role;
|
|
use App\Models\SocialProvider;
|
|
use App\Models\User;
|
|
use Illuminate\Database\Eloquent\Relations\Relation;
|
|
use Illuminate\Support\Carbon;
|
|
use Illuminate\Support\Facades\Mail;
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
class AppServiceProvider extends ServiceProvider
|
|
{
|
|
/**
|
|
* Register any application services.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function register()
|
|
{
|
|
}
|
|
|
|
/**
|
|
* Bootstrap any application services.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function boot() {
|
|
Carbon::setLocale(config('app.locale'));
|
|
|
|
if ($this->app->environment('local')) Mail::alwaysTo('panabonic@yandex.ru');
|
|
|
|
Relation::enforceMorphMap([
|
|
'asset' => Asset::class,
|
|
'permission' => Permission::class,
|
|
'role' => Role::class,
|
|
'social-provider' => SocialProvider::class,
|
|
'user' => User::class,
|
|
|
|
'dictionary' => Dictionary::class,
|
|
'dictionary-item' => DictionaryItem::class,
|
|
|
|
'object-field' => Field::class,
|
|
'fields-group' => FieldsGroup::class,
|
|
'object' => NirObject::class,
|
|
'object-type' => ObjectType::class,
|
|
|
|
'page' => Page::class,
|
|
'publication' => Publication::class,
|
|
|
|
'registry' => Registry::class,
|
|
'registry-category' => Category::class,
|
|
'registry-entry' => Entry::class
|
|
]);
|
|
}
|
|
}
|