48 lines
1.4 KiB
PHP
48 lines
1.4 KiB
PHP
<?php
|
|
|
|
namespace Modules\QualityManagement\Providers;
|
|
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
class QualityManagementServiceProvider extends ServiceProvider
|
|
{
|
|
protected $moduleName = 'QualityManagement';
|
|
|
|
protected $moduleNameLower = 'qualitymanagement';
|
|
|
|
public function boot(): void
|
|
{
|
|
$this->registerTranslations();
|
|
$this->registerConfig();
|
|
$this->registerViews();
|
|
$this->loadMigrationsFrom(module_path($this->moduleName, 'Database/Migrations'));
|
|
}
|
|
|
|
public function register(): void
|
|
{
|
|
$this->app->register(RouteServiceProvider::class);
|
|
$this->app->singleton(\Modules\QualityManagement\Services\QmsIntegrationService::class);
|
|
$this->app->singleton(\Modules\QualityManagement\Services\NcrWorkflowService::class);
|
|
$this->app->singleton(\Modules\QualityManagement\Services\SpcAnalysisService::class);
|
|
}
|
|
|
|
protected function registerConfig(): void
|
|
{
|
|
$this->mergeConfigFrom(
|
|
module_path($this->moduleName, 'Config/config.php'),
|
|
$this->moduleNameLower
|
|
);
|
|
}
|
|
|
|
public function registerViews(): void
|
|
{
|
|
$sourcePath = module_path($this->moduleName, 'Resources/views');
|
|
$this->loadViewsFrom([$sourcePath], $this->moduleNameLower);
|
|
}
|
|
|
|
public function registerTranslations(): void
|
|
{
|
|
$this->loadTranslationsFrom(module_path($this->moduleName, 'Resources/lang'), $this->moduleNameLower);
|
|
}
|
|
}
|