1 month ago

Laravel route question

Posted 1 month ago by Daniel1836

I'm trying to get this code snippet to work.

a href="{{ route('profile', Auth::user()) }}">My Profile</a

It says route not defined.

My web.php route looks like this

Route::get('/profiles/{user}', '[email protected]');

I am not sure if this route is what I should be troubleshooting or if there is a file elsewhere, as I am quite new to Laravel.

I am following a tutorial step by step,I'm not sure where I'm tripping up.

Everything else in the Controller, View, Route is working for this, it just errors when I try the first bit of code I mentioned.

Also, is there any way I can use URL instead of route, then pass the authenticated user? If the URL is http://mysite.com/profile/{user}

(excuse that I did not close the a tag, the forum actually did my html in the browser)


Please sign in or create an account to participate in this conversation.