Answer the question
In order to leave comments, you need to log in
How justified is the use of foreign key in Laravel?
Hello.
We are talking about this construction (in migration):
$table->foreign('user_id')->references('id')->on('users');
public function user()
{
return $this->belongsTo('App\User');
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question