/** * Register Expstudio\LaraClip\Attachment with the container. * * @return void */ protected function registerAttachment() { $this->app->bind('Attachment', function ($app, $params) { $config = $app->make('Config', array('name' => $params['name'], 'options' => $params['options'])); $interpolator = $app->make('Interpolator'); $imageProcessor = $app->make($params['options']['image_processing_library']); $resizer = $app->make('Resizer', array('imageProcessor' => $imageProcessor)); $IOWrapper = $app->make('IOWrapper'); $attachment = new Attachment($config, $interpolator, $resizer, $IOWrapper); $storageDriver = $app->make($params['options']['storage'], array('attachment' => $attachment)); $attachment->setStorageDriver($storageDriver); return $attachment; }); }