Sets the IoC container.
public setContainer ( Illuminate\Container\Container $container ) | ||
$container | Illuminate\Container\Container |
/** * Register the service provider. * * @return void */ public function register() { $this->app->bind('sms', function ($app) { $sender = $this->registerSender(); $sms = new SMS($sender); $sms->setContainer($app); $sms->setLogger($app['log']); $sms->setQueue($app['queue']); //Set the from and pretending settings if ($from = config('sms.from', false)) { $sms->alwaysFrom($from); } $sms->setPretending(config('sms.pretend', false)); return $sms; }); }
/** * Sets the IoC container * * @param \SimpleSoftwareIO\SMS\Container $container * @static */ public static function setContainer($container) { return \SimpleSoftwareIO\SMS\SMS::setContainer($container); }
/** * Set a few dependencies on the sms instance. * * @param SMS $sms * @param $app * @return void */ private function setSMSDependencies($sms, $app) { $sms->setContainer($app); $sms->setLogger($app['log']); $sms->setQueue($app['queue']); }