ro
1382976549
changed the function that retrieves a single location to decide what to get based on the variable type, so it doesn't need to be two seperate functions
39 lines
924 B
PHP
39 lines
924 B
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use Illuminate\Support\ServiceProvider;
|
|
use App\Repositories\LocationRepository;
|
|
use App\Services\UpdateService;
|
|
use App\Services\MaintenanceService;
|
|
use App\Models\Location;
|
|
|
|
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(UpdateService::class, function ($app) {
|
|
return new UpdateService(new LocationRepository(new Location()));
|
|
});
|
|
|
|
$this->app->bind(MaintenanceService::class, function ($app) {
|
|
return new MaintenanceService(new Location());
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Bootstrap any application services.
|
|
*/
|
|
public function boot(): void
|
|
{
|
|
//
|
|
}
|
|
}
|