Last active
July 31, 2020 18:20
-
-
Save lfbn/ab20160eafb3b93611c6eb1e1903bddb to your computer and use it in GitHub Desktop.
RepositoryServiceProvider #laravel #laravel_repositories
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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