📅  最后修改于: 2022-03-11 14:54:30.853000             🧑  作者: Mango
// order one relation with a specific order
Model::with(['relation1'])
->with(['relation2' => function($query) {
$query->orderBy('relation2_column_name','DESC');
}
])
->where('slug', $slug)->first();