You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I've got a prob when I'm using routes name.
If I do this : $menu->url('/', 'Home'), ['icon' => 'fa fa-home']);
It's work!
But not this : $menu->route('homepage','Home');
I've got an error :
ErrorException in MenuItem.php line 536: Object of class Illuminate\Routing\UrlGenerator could not be converted to string...
Someone have an idea where is the prob ?
Thank in advance!
The text was updated successfully, but these errors were encountered:
That's because since Laravel 5.2, "The url() helper function now returns a Illuminate\Routing\UrlGenerator instance when no path is provided." (Source)
Method MenuItem->getActiveStateFromRoute calls url() without parameters, thus returning an UrlGenerator method instead of an URL string.
There's a pull request open, but pingpong-labs seems AFK to implement it.
Other people have forked the library and fixed it there. You could use Terranet's in the meantime. It's even on Packagist.
Hi,
I've got a prob when I'm using routes name.
If I do this :
$menu->url('/', 'Home'), ['icon' => 'fa fa-home']);
It's work!
But not this :
$menu->route('homepage','Home');
I've got an error :
Someone have an idea where is the prob ?
Thank in advance!
The text was updated successfully, but these errors were encountered: