Skip to content

Instantly share code, notes, and snippets.

@lfbn
Last active July 31, 2020 18:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lfbn/ab20160eafb3b93611c6eb1e1903bddb to your computer and use it in GitHub Desktop.
Save lfbn/ab20160eafb3b93611c6eb1e1903bddb to your computer and use it in GitHub Desktop.
RepositoryServiceProvider #laravel #laravel_repositories
<?php
namespace App\Providers;
use App\Repositories\CategoryRepositoryInterface;
use App\Repositories\Eloquent\BaseRepository;
use App\Repositories\Eloquent\CategoryRepository;
use App\Repositories\Eloquent\EloquentRepositoryInterface;
use App\Repositories\Eloquent\QuoteRepository;
use App\Repositories\QuoteRepositoryInterface;
use Illuminate\Support\ServiceProvider;
/**
* Class RepositoryServiceProvider
* @package App\Providers
*/
class RepositoryServiceProvider extends ServiceProvider
{
/**
* Register services.
*
* @return void
*/
public function register(): void
{
$this->app->bind(
EloquentRepositoryInterface::class,
BaseRepository::class
);
$this->app->bind(
QuoteRepositoryInterface::class,
QuoteRepository::class
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment