One-to-Many means one record in a table can have many records in another table.

User Model:
public function posts()
{
return $this->hasMany(Post::class);
}Post Model:
public function user()
{
return $this->belongsTo(User::class);
}
One-to-Many means one record in a table can have many records in another table.

User Model:
public function posts()
{
return $this->hasMany(Post::class);
}Post Model:
public function user()
{
return $this->belongsTo(User::class);
}