I am trying to pass the username via the url.
site.tld/{username}/account
So i have this entry here in my routes
Route::group(array('prefix' => '{username}'), function($username)
{
$user = User::whereUsername($username)->first();
if(!is_null($user))
{
Route::get('portfolio', 'PortfolioController@getIndex');
Route::get('profile', 'ProfileController@getIndex');
....
}
}
i get the following error.
Object of class Illuminate\Routing\Router could not be converted to string
What am i doing wrong?