Skip to content

Instantly share code, notes, and snippets.

@maciejmiara
Created February 26, 2019 22:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save maciejmiara/04138fa70111927e2c5884dbcdd7c568 to your computer and use it in GitHub Desktop.
Save maciejmiara/04138fa70111927e2c5884dbcdd7c568 to your computer and use it in GitHub Desktop.
Laravel provider for dependency injection
<?php
namespace App\Providers;
use Domain\Repository\RunnerRepository;
use Domain\Repository\RunParticipationRepository;
use Domain\Repository\RunRepository;
use Domain\Repository\RunResultRepository;
use Illuminate\Support\ServiceProvider;
class RunnerProvider extends ServiceProvider
{
public $bindings = [
RunnerRepository::class => \Infrastructure\Eloquent\Repository\RunnerRepository::class,
RunRepository::class => \Infrastructure\Eloquent\Repository\RunRepository::class,
RunParticipationRepository::class => \Infrastructure\Eloquent\Repository\RunParticipationRepository::class,
RunResultRepository::class => \Infrastructure\Eloquent\Repository\RunResultRepository::class,
];
/**
* Register services.
*
* @return void
*/
public function register()
{
//
}
/**
* Bootstrap services.
*
* @return void
*/
public function boot()
{
//
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment