//
class essay extends Model
{
public function comment()
{
return $this->hasMany("App\comment")
}
}
//
class comment extends Model
{
public function essay()
{
return $this->belongsTo("App\essay")
}
}
how to get the first 10 comments in each article
// 10
essay::with(["comment" => function($query) {
$query->take(10)
}])
ask all the bosses to help