Well, the code describes it all. I have an Entity service provider that passes an instance of a playlist model that should receive an array as the first parameter to the constructor. How to pass this parameter through app-> bind? Knowing that EntityServiceProvider is automatically entered when specified in the controller.
$this->app->bind('Playlist\PlaylistEntity', function($app)
{
return new PlaylistEntity($app->make('Playlist\PlaylistRepositoryInterface'));
});
$this->app->bind('Playlist\PlaylistEntity', function($app)
{
return new PlaylistEntity($app->make('Playlist\PlaylistRepositoryInterface', $parameters));
});
Similar case: Laravel 4: transferring data from make to the service provider
source
share