[Vuejs]-Is there dynamic way to access relationship in laravel using vuejs?

-1👍

If you want to show all users just write {{ user.name }}

-1👍

You can pass the “with” function in your controller like this:

$users = User::with('shop')->get();

That gives items the users and the user data of those users as well which allows you to access like below:

{{ user.shop.name }}

Leave a comment