26 lines
616 B
PHP
26 lines
616 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Providers;
|
||
|
|
|
||
|
|
use App\Services\MediaImporter;
|
||
|
|
use Illuminate\Contracts\Foundation\Application;
|
||
|
|
use Illuminate\Support\ServiceProvider;
|
||
|
|
|
||
|
|
class MediaImporterServiceProvider extends ServiceProvider
|
||
|
|
{
|
||
|
|
public function register(): void
|
||
|
|
{
|
||
|
|
$this->app->singleton(MediaImporter::class, function (Application $app) {
|
||
|
|
return new MediaImporter();
|
||
|
|
});
|
||
|
|
}
|
||
|
|
|
||
|
|
public function boot(MediaImporter $service): void
|
||
|
|
{
|
||
|
|
$importers = config('gallery.importers');
|
||
|
|
foreach ($importers as $importer) {
|
||
|
|
$service->register($importer);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|