I have this query in Eloquent (Laravel)
$cats = App\Category::leftJoin('categories as b', 'categories.cat_parent', 'b.id')
->orderBy('b.id')
->get([
'b.id as father_id',
'categories.img as img',
'b.descr as child_descr',
'categories.id as child_id',
'categories.descr as father_descr'
]);
which always gives me the same order when rendered in my view on localhost but when I go to the website, the order changes after each refresh.
What the * is going on ? Can anyone please help me to fix this ?
Both localhost and server use MySQL.
Table categories is defined as (id, descr, cat_parent, img, slug).