Skip to content

Commit

Permalink
Pass the container into the controller dispatcher
Browse files Browse the repository at this point in the history
  • Loading branch information
JosephSilber committed Jun 22, 2016
1 parent 946edc9 commit 6343ce7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
19 changes: 19 additions & 0 deletions src/Illuminate/Routing/ControllerDispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,29 @@

namespace Illuminate\Routing;

use Illuminate\Container\Container;

class ControllerDispatcher
{
use RouteDependencyResolverTrait;

/**
* The container instance.
*
* @var \Illuminate\Container\Container
*/
protected $container;

/**
* Create a new controller dispatcher instance.
*
* @param \Illuminate\Container\Container $container
*/
public function __construct(Container $container)
{
$this->container = $container;
}

/**
* Dispatch a request to a given controller and method.
*
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Routing/Route.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ protected function runCallable()
*/
protected function runController()
{
return (new ControllerDispatcher)->dispatch(
return (new ControllerDispatcher($this->container))->dispatch(
$this, $this->getController(), $this->getControllerMethod()
);
}
Expand Down

0 comments on commit 6343ce7

Please sign in to comment.