Skip to content

1.2.0.1

Compare
Choose a tag to compare
@danteay danteay released this 12 Feb 21:53
· 7 commits to master since this release

Features

  • Add logging in the global errorHandler dependency.
  • Add logging on ExceptionHelper::proccessException function
  • Add pagination that not dependes of the Ilumminate/pagination package:
    $items = MyModel::pagination($limit, $page, false)
    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 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 called links 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 
            ...
           ]
        }
      }