Relations
Has many
// ...
use Vendor\Domain\Entity\Posts;
// ...
class Users extends Entity
{
// ...
public function posts()
{
return $this->hasMany(Posts::class)
->foreignKey('user_id');
}
// ...
}Belongs to
Has many and belongs to (MTM)
Has one
Has parent / Has children
Morphed by
Morphs many
Last updated