resolve('laravel.response')->error('404'); } /** * Dynamically resolve items from the application IoC container. * * First, "laravel." will be prefixed to the requested item to see if there is * a matching Laravel core class in the IoC container. If there is not, we will * check for the item in the container using the name as-is. * * * // 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."); } }