When I use the command "php artisan route:list" I have this error
[Illuminate\Container\BindingResolutionException]
Unresolvable dependency resolving [Parameter #0 [ <required> $methods ]] in class Illuminate\Routing\Route
The command works nicely when I have
Route::get('/', 'WelcomeController@index');
Route::get('home', 'HomeController@index');
but as soon as i add other routes, I have this exception
I found the problem :
I'm doing IOC in the controller and I inject Illuminate\Routing\Route. As soon as i delete the injection its works.
I have BaseController which extends Controller.
The BaseController is
class BaseController extends Controller {
/**
* @var array Options used by the pages
*/
protected $options;
/**
* @param Route $route
*/
public function __construct(Route $route)
{
$this->options = Option::getAutoloaded();
// Load the options for the named route page
$this->options = array_merge($this->options, Option::getByPage($route->getAction()['as']));
$this->initListPlugins();
}
A controller is
class MediasController extends BaseController {
public function __construct(Route $route)
{
parent::__construct($route);
$this->options = array_merge($this->options, Option::getByPage('media'));
}
Now thre problem is how I fix it :)
Thanx for your help
Route::controllers([ 'auth' => 'Auth\AuthController', 'password' => 'Auth\PasswordController', ]);
– Lolo