50 lines
2.0 KiB
PHP
50 lines
2.0 KiB
PHP
<?php
|
|
|
|
namespace Modules\Core\Providers;
|
|
|
|
use Illuminate\Support\Facades\Blade;
|
|
use Illuminate\Support\ServiceProvider;
|
|
use Modules\Core\Command\AnonymizeCommand;
|
|
use Modules\Core\Command\BackfillMissingSkusCommand;
|
|
use Modules\Core\Command\ExportCleanupCommand;
|
|
use Modules\Core\Command\ExportCommand;
|
|
use Modules\Core\Command\ImportCommand;
|
|
use Modules\Core\Command\InstallLunarCommand;
|
|
use Modules\Core\Command\MigrateImportCommand;
|
|
use Modules\Core\Command\ProcessErasureRequestsCommand;
|
|
use Modules\Core\Command\TuneProductSearchCommand;
|
|
use Modules\Core\Command\WipeCatalogCommand;
|
|
|
|
class CoreServiceProvider extends ServiceProvider
|
|
{
|
|
public function register(): void
|
|
{
|
|
$this->mergeConfigFrom(__DIR__ . '/../../config/core.php', 'core');
|
|
}
|
|
|
|
public function boot(): void
|
|
{
|
|
$this->loadViewsFrom(__DIR__ . '/../../resources/views', 'core');
|
|
Blade::anonymousComponentPath(__DIR__ . '/../../resources/views', 'core');
|
|
$this->loadMigrationsFrom(__DIR__ . '/../../database/migrations');
|
|
$this->loadTranslationsFrom(__DIR__ . '/../../lang', 'core');
|
|
|
|
$this->publishes([
|
|
__DIR__ . '/../../config/core.php' => config_path('core.php'),
|
|
__DIR__ . '/../../config/scout.php' => config_path('scout.php'),
|
|
], 'core-config');
|
|
|
|
$this->publishes([
|
|
__DIR__ . '/../../resources/logos' => public_path('static/logos/core'),
|
|
__DIR__ . '/../../resources/js/stoic_embed.js' => public_path('js/stoic_embed.js'),
|
|
], 'core-assets');
|
|
|
|
if ($this->app->runningInConsole()) {
|
|
$this->commands([AnonymizeCommand::class, ExportCommand::class, ExportCleanupCommand::class, ImportCommand::class, MigrateImportCommand::class, TuneProductSearchCommand::class, BackfillMissingSkusCommand::class, ProcessErasureRequestsCommand::class, WipeCatalogCommand::class]);
|
|
|
|
//Overriding lunar:install
|
|
$this->app->booted(fn() => $this->commands([InstallLunarCommand::class]));
|
|
}
|
|
}
|
|
}
|