37 lines
1.5 KiB
PHP
37 lines
1.5 KiB
PHP
<?php
|
|
|
|
namespace Modules\Marketplace\Providers;
|
|
|
|
use Illuminate\Support\ServiceProvider;
|
|
use Modules\Marketplace\Console\Commands\MarketplaceAuditCommand;
|
|
use Modules\Marketplace\Console\Commands\MarketplaceSyncCommand;
|
|
use Modules\Marketplace\Services\CompatibilityChecker;
|
|
use Modules\Marketplace\Services\DependencyResolver;
|
|
use Modules\Marketplace\Services\MarketplaceManager;
|
|
use Modules\Marketplace\Services\PackageManifest;
|
|
use Modules\Marketplace\Services\PackageVerifier;
|
|
|
|
final class MarketplaceServiceProvider extends ServiceProvider
|
|
{
|
|
public function register(): void
|
|
{
|
|
$this->mergeConfigFrom(module_path('Marketplace', 'Config/config.php'), 'marketplace');
|
|
$this->app->singleton(PackageManifest::class);
|
|
$this->app->singleton(CompatibilityChecker::class);
|
|
$this->app->singleton(DependencyResolver::class);
|
|
$this->app->singleton(PackageVerifier::class);
|
|
$this->app->singleton(MarketplaceManager::class);
|
|
$this->app->register(RouteServiceProvider::class);
|
|
}
|
|
|
|
public function boot(): void
|
|
{
|
|
$this->loadMigrationsFrom(module_path('Marketplace', 'Database/Migrations'));
|
|
$this->loadViewsFrom(module_path('Marketplace', 'Resources/views'), 'marketplace');
|
|
$this->loadTranslationsFrom(module_path('Marketplace', 'Resources/lang'), 'marketplace');
|
|
if ($this->app->runningInConsole()) {
|
|
$this->commands([MarketplaceSyncCommand::class, MarketplaceAuditCommand::class]);
|
|
}
|
|
}
|
|
}
|