In the Laravel Eloquent Model::all()
function, what is the default ordering for the returned query? I ask this because I'm pretty sure it's in ascending order by primary key which defaults do 'id'
when you make the model through
php artisan make:model Model -m
However, when I call it like this:
return $users = User::all();
I get the following results in the browser:
The results seem to be in no particular order by any of the attributes. I am fully aware I can order them by id by doing
return $users = User::orderBy('id', 'asc')->get();
But just a few days ago they were being ordered automatically. What gives?