Laravel 5 : php artisan route:list Illuminate\Container\BindingResolutionException] -
when use command "php artisan route:list" have error
[illuminate\container\bindingresolutionexception] unresolvable dependency resolving [parameter #0 [ <required> $methods ]] in class illuminate\routing\route
the command works nicely when have
route::get('/', 'welcomecontroller@index'); route::get('home', 'homecontroller@index');
but add other routes, have exception
i found problem :
i'm doing ioc in controller , inject illuminate\routing\route. delete injection works.
i have basecontroller extends controller.
the basecontroller is
class basecontroller extends controller { /** * @var array options used pages */ protected $options; /** * @param route $route */ public function __construct(route $route) { $this->options = option::getautoloaded(); // load options 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 how fix :)
thanx help
when ever see error think of typo's, make sure recheck those.
just make sure route linked correct controller@function:
route::get('medias', ['uses' => 'mediascontroller@getmedialist', 'as' => 'medias.index'])
would go mediascontroller in http/controllers:
class mediascontroller extends controller {
public function getmedialist() { return view('medialist'); }
}
also make sure controller has correct return view. , if you're using
{!! link_to_route('medias.index', 'media list') !!}
make sure have "illuminate/html": "5.0.*@dev" installed through composer.json aswell.
Comments
Post a Comment