Created
January 26, 2015 14:31
-
-
Save kejyun/45236819b1a4f58f3eaf to your computer and use it in GitHub Desktop.
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 Repositories\Pokemon; | |
// model\Repositories\Pokemon\PokemonRepositoryServiceProvider.php | |
use Entities\Pokemon; | |
use Repositories\Pokemon\PokemonRepository; | |
use Illuminate\Support\ServiceProvider; | |
/** | |
* Register our Repository with Laravel | |
* 註冊我們的資源庫到 Laravel | |
*/ | |
class PokemonRepositoryServiceProvider extends ServiceProvider | |
{ | |
/** | |
* Registers the pokemonInterface with Laravels IoC Container | |
* 註冊 pokemonInterface 介面到 Laravel IoC Container 中 | |
*/ | |
public function register() | |
{ | |
// Bind the returned class to the namespace 'Repositories\PokemonInterface | |
$this->app->bind('Repositories\Pokemon\PokemonInterface', function($app) | |
{ | |
return new PokemonRepository(new Pokemon()); | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment