Support the ongoing development of Laravel.io →
Database Views Blade

In my laravel application, when I am trying to link the username of the person who has posted in the website with his profile page, with the code:

<div class="media-body"><a href="@{{ post.user.profileUrl }}">@{{ post.user.name }}</a> It is giving the error,

Sorry, the page you are looking for could not be found.

1/1 NotFoundHttpException in RouteCollection.php line 161:

But, when I am trying to print, @{{ post.user.profileUrl }} it is giving the right address, also in the json response, it is giving the right address, and going to the address is also reaching the specific location.

So, I don’t think it is some problem with post.user.profileUrl, as it seems to work fine, it seems to be some problem with using it with href, the address of the error in google chrome is :

http://localhost:8000/%7B%7B%20post.user.profileUrl%20%7D%7D

and the address should have been

http://localhost:8000/users/2 where 2 refers to the id of the user, which I am passing to the user through Vue.js

I am stuck on just this issue for more than 3 days now.

Please help me on this issue, because I found no one else who can actually solve it.

Last updated 3 years ago.
0

Your variable seems to be missing the $:

{{$post.user.profileUrl}}

Also, what does the @ do in your href? I assume the url should not be http://localhost:8000/@users/2

Last updated 8 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

ronit5rg ronit5rg Joined 24 Jun 2016

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.

© 2025 Laravel.io - All rights reserved.