If you're using URL::route() the second argument is an optional array for parameters, try something like this:
{{ URL::route( 'get-admin-dashboard', [ 'username' => Auth::user()->username ] ) }}
URL::route('get-admin-dashboard', array('username-here'))
should do you. Just put all possible params in that array (in your case just one param, of course).
If you're trying to make a link you should probably use {{ link_to_route('get-admin-dashboard', 'Dashboard', array('username-here')) }}
or {{ HTML::linkRoute('get-admin-dashboard', 'Dashboard', array('username-here')) }}
You have the array outside the function. Change it to:
<li><a href="<?php echo URL::route('get-admin-dashboard', array( 'username' => Auth::user()->username) ); ?>">Profile</a></li>
You could even make it cleaner using the linkRoute method off the HTML facade:
<li>
{{ HTML::linkRoute( 'get-admin-dashboard', 'Profile', array( 'username' => Auth::user()->username ) }}
</li>
Edit: Noticed you removed your last post and marked the thread as solved, so guess you figured it out :) Happy coding!
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community