A
A
artyak11212020-01-22 00:17:36
Laravel
artyak1121, 2020-01-22 00:17:36

Laravel. How to select fields correctly?

There is a table giveaway, it has a winner column winner_id, where the user ID is entered on the site. It is necessary that the ID from the winner_id column be searched in the table usersand displayed on the site who found the user's login. How can you do it right?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Eugene, 2020-01-22
@Eugene70

One to One relationship ( https://laravel.com/docs/6.x/eloquent-relationship... You add a foreign key to the migration and get giveaway->winner();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question