User::find()
->orderBy(['id' => SORT_DESC])
->all();
class UsersRepository
{
public function getLastUsers()
{
return new ActiveDataProvider([
'query' => User::find(),
'sort' => ['defaultOrder' => ['id' => SORT_DESC]]
]);
}
}