2024-03-01 20:34:36 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Providers;
|
|
|
|
|
|
|
|
use Illuminate\Support\ServiceProvider;
|
2024-05-13 06:14:53 +02:00
|
|
|
//Repos
|
2024-03-05 20:27:27 +01:00
|
|
|
use App\Repositories\PageRepository;
|
|
|
|
use App\Interfaces\PageRepositoryInterface;
|
2024-05-13 20:06:05 +02:00
|
|
|
use App\Repositories\MemberRepository;
|
|
|
|
use App\Interfaces\MemberRepositoryInterface;
|
2024-05-13 06:14:53 +02:00
|
|
|
//Asset Services
|
|
|
|
use App\Services\Assets\AssetService;
|
|
|
|
use App\Services\Assets\DocService;
|
|
|
|
use App\Services\Assets\FileUploadService;
|
|
|
|
use App\Services\Assets\RenderService;
|
|
|
|
//Data Services
|
|
|
|
use App\Services\Data\SettingsService;
|
|
|
|
use App\Services\Data\ContentService;
|
|
|
|
use App\Services\Data\PaginateService;
|
|
|
|
use App\Services\Data\ThemeService;
|
|
|
|
use App\Services\Data\SortingService;
|
|
|
|
//Upkeep Services
|
|
|
|
use App\Services\UpKeep\MaintenanceService;
|
|
|
|
use App\Services\UpKeep\InitService;
|
2024-03-01 20:34:36 +01:00
|
|
|
|
|
|
|
class FipamoServiceProvider extends ServiceProvider
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Register services.
|
|
|
|
*/
|
|
|
|
public function register(): void
|
|
|
|
{
|
2024-03-05 20:27:27 +01:00
|
|
|
//services
|
2024-03-01 20:34:36 +01:00
|
|
|
$this->app->bind(SettingsService::class, function ($app) {
|
2024-03-22 21:35:44 +01:00
|
|
|
return new SettingsService(new DocService(), new ContentService());
|
2024-03-01 20:34:36 +01:00
|
|
|
});
|
|
|
|
|
2024-03-04 00:49:05 +01:00
|
|
|
$this->app->bind(ContentService::class, function ($app) {
|
|
|
|
return new ContentService();
|
|
|
|
});
|
|
|
|
|
2024-03-06 17:27:41 +01:00
|
|
|
$this->app->bind(ThemeService::class, function ($app) {
|
2024-03-22 21:35:44 +01:00
|
|
|
return new ThemeService(new SettingsService(new DocService(), new ContentService()));
|
2024-03-06 17:27:41 +01:00
|
|
|
});
|
|
|
|
|
2024-03-04 00:49:05 +01:00
|
|
|
$this->app->bind(PaginateService::class, function ($app) {
|
|
|
|
return new PaginateService(new ContentService());
|
|
|
|
});
|
2024-03-08 21:09:43 +01:00
|
|
|
|
|
|
|
$this->app->bind(DocService::class, function ($app) {
|
|
|
|
return new DocService();
|
|
|
|
});
|
2024-03-11 23:32:38 +01:00
|
|
|
|
|
|
|
$this->app->bind(FileUploadService::class, function ($app) {
|
|
|
|
return new FileUploadService();
|
|
|
|
});
|
2024-03-14 19:39:43 +01:00
|
|
|
|
|
|
|
$this->app->bind(RenderService::class, function ($app) {
|
2024-03-14 23:58:11 +01:00
|
|
|
return new RenderService(
|
|
|
|
new SortingService(
|
2024-03-22 21:35:44 +01:00
|
|
|
new SettingsService(new DocService(), new ContentService()),
|
2024-03-14 23:58:11 +01:00
|
|
|
new ContentService(),
|
2024-03-22 21:35:44 +01:00
|
|
|
new ThemeService(new SettingsService(new DocService(), new ContentService()))
|
2024-03-14 23:58:11 +01:00
|
|
|
),
|
2024-03-22 21:35:44 +01:00
|
|
|
new SettingsService(new DocService(), new ContentService()),
|
2024-03-18 23:14:17 +01:00
|
|
|
new ContentService(),
|
2024-03-14 23:58:11 +01:00
|
|
|
);
|
2024-03-14 19:39:43 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
$this->app->bind(SortingService::class, function ($app) {
|
|
|
|
return new SortingService(
|
2024-03-22 21:35:44 +01:00
|
|
|
new SettingsService(new DocService(), new ContentService()),
|
2024-03-14 19:39:43 +01:00
|
|
|
new ContentService(),
|
2024-03-22 21:35:44 +01:00
|
|
|
new ThemeService(new SettingsService(new DocService(), new ContentService()))
|
2024-03-14 19:39:43 +01:00
|
|
|
);
|
|
|
|
});
|
2024-03-16 19:36:51 +01:00
|
|
|
|
|
|
|
$this->app->bind(AssetService::class, function ($app) {
|
|
|
|
return new AssetService(
|
|
|
|
new ThemeService(
|
2024-03-22 21:35:44 +01:00
|
|
|
new SettingsService(new DocService(), new ContentService())
|
2024-03-16 19:36:51 +01:00
|
|
|
)
|
|
|
|
);
|
|
|
|
});
|
2024-04-05 20:29:38 +02:00
|
|
|
|
|
|
|
$this->app->bind(MaintenanceService::class, function ($app) {
|
|
|
|
return new MaintenanceService(
|
|
|
|
new SettingsService(new DocService(), new ContentService())
|
|
|
|
);
|
|
|
|
});
|
2024-04-16 23:36:57 +02:00
|
|
|
|
|
|
|
$this->app->bind(InitService::class, function ($app) {
|
|
|
|
return new InitService(new DocService());
|
|
|
|
});
|
2024-03-01 20:34:36 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Bootstrap services.
|
|
|
|
*/
|
|
|
|
public function boot(): void
|
|
|
|
{
|
2024-03-05 20:27:27 +01:00
|
|
|
$this->app->bind(PageRepositoryInterface::class, PageRepository::class);
|
2024-05-13 20:06:05 +02:00
|
|
|
$this->app->bind(MemberRepositoryInterface::class, MemberRepository::class);
|
2024-03-01 20:34:36 +01:00
|
|
|
}
|
|
|
|
}
|