lundi 6 janvier 2020

Laravel (hasManyThrough eloquent relation) - WhereHas with OrderBy working on localhost, not working on server

Laravel (hasManyThrough eloquent relation) - WhereHas with OrderBy working on localhost, not working on server. On localhost it working, it sorting (ordering) well, but on live server dont ordering well. On localhost is MARIADB on live server is MYSQL.

public function index(Product $product)

{
 $products = Product::with(['subcategory', 'subcategory.category'])->whereHas('subcategory', function ($query) {
     $query->whereHas('category', function ($query) {
     $query->orderBy('category_id', 'asc');
 }); })->get();

  return view('products.index', compact('products'));
}


from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2ZTDDkt
via IFTTT

Aucun commentaire:

Enregistrer un commentaire