$items = Product::with([ 'brand' => function ($query) { $query->orderBy('position', 'ASC'); } ]) ->paginate(10);
$items = Product::join('brands', 'product.brand_id', '=', 'brands.id') ->orderBy('brands.position', 'ASC') ->paginate(10);
Related questions
Find more questions by tags PHPMySQLLaravelSQL