1.2.0.1
Features
- Add logging in the global errorHandler dependency.
- Add logging on ExceptionHelper::proccessException function
- Add pagination that not dependes of the Ilumminate/pagination package:
This fuction is a scope function of Eloquent ORM, and is attached to the BaseModel class of the project. You can use this funtion instead of the
$items = MyModel::pagination($limit, $page, false)
get
function to return the elements of the query.
This function has 3 parameters:- $limit: this is the number of elements by page that can return the pagination
- $page: this is the page number that you want, if you provide an invalid number the pagination automatically retrieves the page 1 if you insert a page lower than 1, and if you provide a number higher than the total of pages, the pagination will retrieve the last page.
- $links: this is a boolean flag that manage if the pagination has to contain the links of the pages to render in frontend (you can check how it works at
librarires/Pagination/Utils::links
function). If you set the value to true, the resultant payload will contain an item calledlinks
that contain an array with the name of the pages to display.{ "data": [ ... ] //resultant objects "pages": { "limit": 100 // elements by page "pages": 1 // total of pages "total": 70 // total of elements in all the pages "page": 1 // current page "links": [ 1, "...", 2 ... ] } }