fipamo/app/Providers/FipamoServiceProvider.php
ro 177f29802b
added page repository and interface
plugged in classes for a page repository to handle editing and
retrieving page content and an interface class for the controller to talk to to
keep the methodoloy seperate from the controller to keep it all clean

now whatever changes that need to be made won't bother the controller
because it will always be looking for the same functions. super sweet
2024-03-05 13:27:27 -06:00

46 lines
1.1 KiB
PHP

<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use App\Repositories\PageRepository;
use App\Interfaces\PageRepositoryInterface;
use App\Services\SettingsService;
use App\Services\AuthService;
use App\Services\ContentService;
use App\Services\PaginateService;
class FipamoServiceProvider extends ServiceProvider
{
/**
* Register services.
*/
public function register(): void
{
//services
$this->app->bind(SettingsService::class, function ($app) {
return new SettingsService();
});
$this->app->bind(AuthService::class, function ($app) {
return new AuthService(new SettingsService());
});
$this->app->bind(ContentService::class, function ($app) {
return new ContentService();
});
$this->app->bind(PaginateService::class, function ($app) {
return new PaginateService(new ContentService());
});
}
/**
* Bootstrap services.
*/
public function boot(): void
{
$this->app->bind(PageRepositoryInterface::class, PageRepository::class);
}
}