2024-03-01 20:34:36 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Providers;
|
|
|
|
|
|
|
|
use Illuminate\Support\ServiceProvider;
|
2024-03-05 20:27:27 +01:00
|
|
|
use App\Repositories\PageRepository;
|
|
|
|
use App\Interfaces\PageRepositoryInterface;
|
2024-03-01 20:34:36 +01:00
|
|
|
use App\Services\SettingsService;
|
|
|
|
use App\Services\AuthService;
|
2024-03-04 00:49:05 +01:00
|
|
|
use App\Services\ContentService;
|
|
|
|
use App\Services\PaginateService;
|
2024-03-06 17:27:41 +01:00
|
|
|
use App\Services\ThemeService;
|
2024-03-08 21:09:43 +01:00
|
|
|
use App\Services\DocService;
|
2024-03-14 19:39:43 +01:00
|
|
|
use App\Services\StringService;
|
2024-03-11 23:32:38 +01:00
|
|
|
use App\Services\FileUploadService;
|
2024-03-14 19:39:43 +01:00
|
|
|
use App\Services\RenderService;
|
|
|
|
use App\Services\SortingService;
|
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-12 23:16:36 +01:00
|
|
|
return new SettingsService(new DocService());
|
2024-03-01 20:34:36 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
$this->app->bind(AuthService::class, function ($app) {
|
2024-03-12 23:16:36 +01:00
|
|
|
return new AuthService(new SettingsService(new DocService()));
|
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-12 23:16:36 +01:00
|
|
|
return new ThemeService(new SettingsService(new DocService()));
|
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(StringService::class, function ($app) {
|
|
|
|
return new StringService();
|
|
|
|
});
|
|
|
|
|
|
|
|
$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) {
|
|
|
|
return new RenderService();
|
|
|
|
});
|
|
|
|
|
|
|
|
$this->app->bind(SortingService::class, function ($app) {
|
|
|
|
return new SortingService(
|
|
|
|
new SettingsService(new DocService()),
|
|
|
|
new ContentService(),
|
|
|
|
new StringService(),
|
|
|
|
);
|
|
|
|
});
|
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-03-01 20:34:36 +01:00
|
|
|
}
|
|
|
|
}
|