Commit 07df37c8 authored by Nicolas Widart's avatar Nicolas Widart

Adding MenuRepository classes

parent b34c491f
<?php namespace Modules\Menu\Providers;
use Illuminate\Support\ServiceProvider;
use Modules\Menu\Entities\Menu;
use Modules\Menu\Repositories\Eloquent\EloquentMenuRepository;
class MenuServiceProvider extends ServiceProvider
{
......@@ -19,7 +21,9 @@ class MenuServiceProvider extends ServiceProvider
*/
public function register()
{
//
$this->app->booted(function () {
$this->registerBindings();
});
}
/**
......@@ -32,4 +36,17 @@ class MenuServiceProvider extends ServiceProvider
return array();
}
/**
* Register class binding
*/
private function registerBindings()
{
$this->app->bind(
'Modules\Menu\Repositories\MenuRepository',
function() {
return new EloquentMenuRepository(new Menu);
}
);
}
}
<?php namespace Modules\Menu\Repositories\Eloquent;
use Modules\Core\Repositories\Eloquent\EloquentBaseRepository;
use Modules\Menu\Repositories\MenuRepository;
class EloquentMenuRepository extends EloquentBaseRepository implements MenuRepository
{
}
<?php namespace Modules\Menu\Repositories;
use Modules\Core\Repositories\BaseRepository;
interface MenuRepository extends BaseRepository
{
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment