Skip to content

Instantly share code, notes, and snippets.

@guiassemany
Created December 28, 2016 12:07
Show Gist options
  • Save guiassemany/795dc1f6c199ab57f642bdba25a578e4 to your computer and use it in GitHub Desktop.
Save guiassemany/795dc1f6c199ab57f642bdba25a578e4 to your computer and use it in GitHub Desktop.
Pass constructor parameters when you're binding an interface to a class
<?php
$this->app->bind('MasterUploader', function($app) use($your_parameter)
{
// Make dependencies ... $any_dependancy_instance = $app->make('AnyDependancy'); etc...
return new EloquentUploader($any_dependancy_instance, $your_parameter);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment