Commit af77d9ad authored by Nicolas Widart's avatar Nicolas Widart

Binding the file repository interface to an implementation

parent 07ebb0ba
<?php namespace Modules\Media\Providers;
use Illuminate\Support\ServiceProvider;
use Modules\Media\Entities\File;
use Modules\Media\Repositories\Eloquent\EloquentFileRepository;
class MediaServiceProvider extends ServiceProvider
{
......@@ -19,7 +21,9 @@ class MediaServiceProvider extends ServiceProvider
*/
public function register()
{
//
$this->app->booted(function () {
$this->registerBindings();
});
}
/**
......@@ -32,4 +36,14 @@ class MediaServiceProvider extends ServiceProvider
return array();
}
private function registerBindings()
{
$this->app->bind(
'Modules\Media\Repositories\FileRepository',
function() {
return new EloquentFileRepository(new File);
}
);
}
}
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