C
C
chelkaz2016-03-11 00:43:06
Laravel
chelkaz, 2016-03-11 00:43:06

What is the best way to link tables?

Questions are stored in one table.
It contains the id of the person who asked
. The user id contains a field with the user's photo. (url)
I pass questions to the questions page like this $ArQuest = \App\Models\Question::paginate(15);
How to link questions to users so that in the view you can get a photo of the user who asked the question?
How will it be done right?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Eugene, 2016-03-11
@chelkaz

https://laravel.com/docs/5.2/eloquent-relationship...
belongsTo

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question