Download the PHP package nimaebrazi/laravel-api-presenter without Composer
On this page you can find all versions of the php package nimaebrazi/laravel-api-presenter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download nimaebrazi/laravel-api-presenter
More information about nimaebrazi/laravel-api-presenter
Files in nimaebrazi/laravel-api-presenter
Download nimaebrazi/laravel-api-presenter
More information about nimaebrazi/laravel-api-presenter
Files in nimaebrazi/laravel-api-presenter
Vendor nimaebrazi
Package laravel-api-presenter
Short Description Provide client response with simple cache.
License MIT
Package laravel-api-presenter
Short Description Provide client response with simple cache.
License MIT
Please rate this library. Is it a good library?
Informations about the package laravel-api-presenter
Laravel API Presenter
Description
Simple and powerful client response integrated with Laravel cache.
Installation
Register ServiceProvider
If using laravel 5.4.* and older version you need add service provider in config/app.php
Usage
1. Response without cache
Example 1.1
Example 1.2
2. Response single object with cache
Example 2.1
Note
It's depend on your application cache driver setting.
For example you can find output key if using redis like:
3. Response with cache and auto pagination
Example 3.1
Note:
Package generate key from meta and transform cache key in redis like:
4. Response with cache and custom pagination
- Pay attention, when use custom meta, you should make custom cache key too.
Suppose you set cache key
users
and paginate your data and respond to clientpage one
. So package set your cacheusers
and not append meta data to cache key. And your response not correct when client limit the result of data and page. - Don't use
withMeta()
method when set custom meta data.
Example 4.1
For more info about MetaModel read class:
How to set custom response?
You access to response object in ApiPresenter.
Suppose you want change response header:
All versions of laravel-api-presenter with dependencies
PHP Build Version
Package Version
Requires
php Version
^7.2
The package nimaebrazi/laravel-api-presenter contains the following files
Loading the files please wait ....