Hi, thanks for the answers
My bad for the typo, i do have a return $row in there, but does not work.
@snapey i do a few more transforms on the row so put that number_format in there for ease as an example.
$results = $rows->getCollection()->transform(function ($row, $key) {
$row->money = Money::pricing($row->retail, $row->vat);
$row->trade = Money::pricing($row->tradeprice, $row->vat);
$row->wsale = Money::pricing($row->wsaleprice, $row->vat);
return $row;
}
Where money is a function that calculate exchange rates, and format pricing into a an array containing
multiple values.
But it just wipes the pagination from the collection and returns just the items:
Illuminate\Database\Eloquent\Collection {#1895 ▼
#items: array:7 [▼
0 => App\Models\Tyre {#1896 ▶}
1 => App\Models\Tyre {#1897 ▶}
2 => App\Models\Tyre {#1898 ▶}
3 => App\Models\Tyre {#1899 ▶}
4 => App\Models\Tyre {#1900 ▶}
5 => App\Models\Tyre {#1901 ▶}
6 => App\Models\Tyre {#1902 ▶}
]
}
Many Thanks