samedi 15 février 2020

how do you get back sum('amount') for a paginated eloquent query In laravel 5?

I have a model Logbook for pilot and my controller Return

$this->log_book->orderBy('flight_date','asc')->paginate(18);

I want to sum total flight time in each page.

total flight time for first page calculate from DB but for second page and next page , $previous_total_page_time should be total time of first page and for next page too.

I don't know how can save a variable temporary $page_previous_total_time and use it in second and next pages

flight time is saved as A Int (minutes in integer)

request is Get

in this image you see my view



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

Aucun commentaire:

Enregistrer un commentaire