Skip to content

Instantly share code, notes, and snippets.

@kejyun
Created January 26, 2015 14:31
Show Gist options
  • Save kejyun/45236819b1a4f58f3eaf to your computer and use it in GitHub Desktop.
Save kejyun/45236819b1a4f58f3eaf to your computer and use it in GitHub Desktop.
<?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