I can't seem to get how to order by month in Laravel 7. I use different columns for my month, day, year and time and instead of ordering it by month, it orders the months alphabetically.
Intended Result: January, February, March, April
Actual Result: April, February, January, March
This is my code:
$ledgers = Ledger::orderBy('month', 'DESC')
->orderBy('day', 'DESC')
->orderBy('year', 'DESC')
->orderBy('time', 'DESC')
->where('user_id', auth()->user()->id)
->paginate(8);