* // 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) { if (IoC::container()->registered($key)) { return IoC::container()->resolve($key); } throw new \Exception("Attempting to access undefined property [$key] on controller."); } }