forked from projects/fipamo
ro
36d04c8f68
service classes are beginning to swell as there functionality is being fleshed out, so a new organizational structure was needed to make sure class sizes don't become too large and to increase site managability and legibilty as more features get added and the code base grows. data is for retrieving, managing site information, assets interact with external files and upkeep is for maintenance. some additional tweaks were also made to the options menu template to prep it for it's transition to a toolbar component
108 lines
3.4 KiB
PHP
108 lines
3.4 KiB
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use Illuminate\Support\ServiceProvider;
|
|
//Repos
|
|
use App\Repositories\PageRepository;
|
|
use App\Interfaces\PageRepositoryInterface;
|
|
//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\AuthService;
|
|
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;
|
|
|
|
class FipamoServiceProvider extends ServiceProvider
|
|
{
|
|
/**
|
|
* Register services.
|
|
*/
|
|
public function register(): void
|
|
{
|
|
//services
|
|
$this->app->bind(SettingsService::class, function ($app) {
|
|
return new SettingsService(new DocService(), new ContentService());
|
|
});
|
|
|
|
$this->app->bind(AuthService::class, function ($app) {
|
|
return new AuthService(new SettingsService(new DocService(), new ContentService()));
|
|
});
|
|
|
|
$this->app->bind(ContentService::class, function ($app) {
|
|
return new ContentService();
|
|
});
|
|
|
|
$this->app->bind(ThemeService::class, function ($app) {
|
|
return new ThemeService(new SettingsService(new DocService(), new ContentService()));
|
|
});
|
|
|
|
$this->app->bind(PaginateService::class, function ($app) {
|
|
return new PaginateService(new ContentService());
|
|
});
|
|
|
|
$this->app->bind(DocService::class, function ($app) {
|
|
return new DocService();
|
|
});
|
|
|
|
$this->app->bind(FileUploadService::class, function ($app) {
|
|
return new FileUploadService();
|
|
});
|
|
|
|
$this->app->bind(RenderService::class, function ($app) {
|
|
return new RenderService(
|
|
new SortingService(
|
|
new SettingsService(new DocService(), new ContentService()),
|
|
new ContentService(),
|
|
new ThemeService(new SettingsService(new DocService(), new ContentService()))
|
|
),
|
|
new SettingsService(new DocService(), new ContentService()),
|
|
new ContentService(),
|
|
);
|
|
});
|
|
|
|
$this->app->bind(SortingService::class, function ($app) {
|
|
return new SortingService(
|
|
new SettingsService(new DocService(), new ContentService()),
|
|
new ContentService(),
|
|
new ThemeService(new SettingsService(new DocService(), new ContentService()))
|
|
);
|
|
});
|
|
|
|
$this->app->bind(AssetService::class, function ($app) {
|
|
return new AssetService(
|
|
new ThemeService(
|
|
new SettingsService(new DocService(), new ContentService())
|
|
)
|
|
);
|
|
});
|
|
|
|
$this->app->bind(MaintenanceService::class, function ($app) {
|
|
return new MaintenanceService(
|
|
new SettingsService(new DocService(), new ContentService())
|
|
);
|
|
});
|
|
|
|
$this->app->bind(InitService::class, function ($app) {
|
|
return new InitService(new DocService());
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Bootstrap services.
|
|
*/
|
|
public function boot(): void
|
|
{
|
|
$this->app->bind(PageRepositoryInterface::class, PageRepository::class);
|
|
}
|
|
}
|