Using ::class notation

parent 1a865b35
......@@ -68,31 +68,25 @@ class MenuServiceProvider extends ServiceProvider
*/
private function registerBindings()
{
$this->app->bind(
'Modules\Menu\Repositories\MenuRepository',
function () {
$repository = new EloquentMenuRepository(new Menu());
$this->app->bind(MenuRepository::class, function () {
$repository = new EloquentMenuRepository(new Menu());
if (! config('app.cache')) {
return $repository;
}
return new CacheMenuDecorator($repository);
if (! config('app.cache')) {
return $repository;
}
);
$this->app->bind(
'Modules\Menu\Repositories\MenuItemRepository',
function () {
$repository = new EloquentMenuItemRepository(new Menuitem());
return new CacheMenuDecorator($repository);
});
if (! config('app.cache')) {
return $repository;
}
$this->app->bind(MenuItemRepository::class, function () {
$repository = new EloquentMenuItemRepository(new Menuitem());
return new CacheMenuItemDecorator($repository);
if (! config('app.cache')) {
return $repository;
}
);
return new CacheMenuItemDecorator($repository);
});
}
/**
......
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