jeudi 29 novembre 2018

Laravel 5.6 orderBy not working in pagination

I got a query below to retrieve all the transactions, I wanted to sort it by the column date, however it still displayed unsorted data.

$transactions = \App\Transaction::latest()->select('transactions.*', 'category_name')->join('categories', 'transactions.category_id', '=', 'categories.id')->
           orderBy('transactions.date','desc')->paginate(8);



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2Q399uI
via IFTTT

Aucun commentaire:

Enregistrer un commentaire