[CLEAR-38] order by created

This commit is contained in:
Artur Nowakowski 2020-01-19 17:42:44 +01:00
parent 36e6cd575c
commit 95a9f9c664

View File

@ -49,7 +49,7 @@ class UsersRepository implements UsersRepositoryInterface
public function getRecipeHistory(int $userID, string $groupBy = 'day')
{
$userRecipes = UsersRecipes::where('user_id', $userID)->orderByDesc('created_at')->get();
$userRecipes = UsersRecipes::where('user_id', $userID)->orderBy('created_at')->get();
$recipeHistory = [];
if ($groupBy == 'month') {
$userRecipes = $userRecipes->groupBy(function ($d) {