Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Platform
Commits
af77d9ad
Commit
af77d9ad
authored
Oct 27, 2014
by
Nicolas Widart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Binding the file repository interface to an implementation
parent
07ebb0ba
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
1 deletion
+15
-1
MediaServiceProvider.php
Providers/MediaServiceProvider.php
+15
-1
No files found.
Providers/MediaServiceProvider.php
View file @
af77d9ad
<?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
);
}
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment