N
N
ninja op op2020-08-01 23:33:15
Laravel
ninja op op, 2020-08-01 23:33:15

How to find user login VUE.JS + Laravel?

I have a MYSQL database inside which are two tables, these are:
1. items (table with products)
2. users (table with users)

inside users, there is an id column, inside items there is a user_id column which is assigned the id value from users of a specific user .

The following is returned to Vue.js:

return response()->json(Item::where('user_id','=',$id)->orderBy('id')->paginate(25));


How can I get the username of each item entry and pass it to vue?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Anton, 2020-08-01
@kur4chyt

https://laravel.com/docs/7.x/eloquent-relationships

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question