I have user
and I've created a profile button such as each user can look for their data.
In UserController.php
I have this function:
/*
* @Get("user/profile/{id}")
*/
public function profile($id)
{
$user = User::find($id);
return view('user.profile', ['user' => $user]);
}
I call it from a view like this:
<ul class="dropdown-menu">
<li>
<?= link_to('user/profile/'.Auth::user()->id, $title = 'Perfil'); ?>
</li>
@if(Auth::user()->type_id == 1)
<li><a href="{!!URL::to('/user')!!}">Administrar</a></li>
@endif
<li role="separator" class="divider"></li>
<li><a href="{!!URL::to('/logout')!!}"><i class="fa fa-sign-out fa-fw"></i>Logout</a></li>
</ul>
That button takes me to the URL I want such as /user/profile/6
for example, but it sends me this error:
NotFoundHttpException in RouteCollection.php line 161: