ForRo/app/Providers/AppServiceProvider.php
ro 682360c140 Added Pagination Service class
Pagination is going to need some additional features in the near future,
so it made sense to give it it's own seperate class.
2024-02-20 12:57:33 -06:00

52 lines
1.3 KiB
PHP

<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use App\Repositories\LocationRepository;
use App\Repositories\SourceRepository;
use App\Services\UpdateService;
use App\Services\MaintenanceService;
use App\Models\Location;
use App\Models\Source;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*/
public function register(): void
{
$this->app->bind(LocationRepository::class, function ($app) {
return new LocationRepository(new Location());
});
$this->app->bind(SourceRepository::class, function ($app) {
return new SourceRepository(new Source());
});
$this->app->bind(UpdateService::class, function ($app) {
return new UpdateService(
new LocationRepository(new Location()),
new SourceRepository(new Source())
);
});
$this->app->bind(MaintenanceService::class, function ($app) {
return new MaintenanceService(new Location());
});
$this->app->bind(PaginationService::class, function ($app) {
return new PaginationService(new Location());
});
}
/**
* Bootstrap any application services.
*/
public function boot(): void
{
//
}
}