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);
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire