lk.zachem.info/app/Modules/Main/Providers/ModuleServiceProvider.php
Thekindbull b5b50159a7 - обновлена работа с администраированием агентств: сделано редактирование данных, а также управление агентами из админки (добавление, удаление)
- проведен рефакторинг компоненты создания агента
- в админку добавлена работа с url на стороне битрикса
- проведен рефакторинг кода по отправке данных в битрикс
- разнесены оставшиеся миграции по модулям
2025-11-11 15:29:04 +08:00

72 lines
1.8 KiB
PHP

<?php
namespace Modules\Main\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Blade;
use Livewire\Livewire;
class ModuleServiceProvider extends ServiceProvider
{
protected string $moduleName = 'Main';
public function register()
{
$this->app->register(RouteServiceProvider::class);
}
public function boot()
{
$this->registerViews();
$this->registerLivewireViews();
$this->registerMigrations();
$this->registerConfig();
$this->registerComponent();
$this->registerLivewire();
}
protected function registerViews()
{
$moduleViewsPath = __DIR__ . '/../Views';
$this->loadViewsFrom(
$moduleViewsPath,
strtolower($this->moduleName)
);
}
protected function registerLivewireViews()
{
$moduleViewsPath = __DIR__ . '/../Views/livewire';
$this->loadViewsFrom(
$moduleViewsPath,
strtolower($this->moduleName)
);
}
protected function registerMigrations()
{
$this->loadMigrationsFrom(
app_path('Modules/' . $this->moduleName . '/Database/Migrations')
);
}
protected function registerConfig()
{
$path = app_path('Modules/' . $this->moduleName . '/Config/config.php');
$this->mergeConfigFrom(
$path,
strtolower($this->moduleName)
);
}
protected function registerLivewire()
{
//Livewire::component('<name>', \Modules\<NAME>\Http\Livewire\<NAME>::class);
Livewire::component('company.agent.create', \Modules\Main\Http\Livewire\CreateAgentLivewire::class);
}
protected function registerComponent()
{
//Blade::component('<name>', \Modules\<NAME>\Http\Components\<NAME>::class);
}
}