Support the ongoing development of Laravel.io →
posted 10 years ago
Testing
Last updated 2 years ago.
0

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 ] ) }}
Last updated 2 years ago.
0

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')) }}

Last updated 2 years ago.
0

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!

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

jacko1998 jacko1998 Joined 2 Apr 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.