* // Resolve the "laravel.input" instance from the IoC container * $input = $this->input; * * // Resolve the "mailer" instance from the IoC container * $mongo = $this->mailer; * * */ public function __get($key) { $container = IoC::container(); if ($container->registered('laravel.'.$key)) { return $container->resolve('laravel.'.$key); } elseif ($container->registered($key)) { return $container->resolve($key); } throw new \Exception("Attempting to access undefined property [$key] on controller."); } }