Answer the question
In order to leave comments, you need to log in
Laravel how to make connection?
is it possible to link tables without migrations? I registered a 1-to-many connection, but the error is
https: //cdn.discordapp.com/attachments/47429631752
...
/attachments/47429631752...
https://cdn.discordapp.com/attachments/47429631752...
Answer the question
In order to leave comments, you need to log in
Class names are incorrect.
Those. instead app\UserModel
of should be App\Models\UserModel
.
I recommend using a special constant ::class
:
for example $this->belongsTo(UserModel::class, 'idu');
, Naming, of course, gouge your eyes out. Why the word Model in class names? Why do all models have custom id-field names?) Well, these are rather rhetorical questions.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question