Develop APIs faster with Laravel Shovel
Laravel Shovel is a minimalist package providing Laravel response macros to assist in rapid API development by transforming models, resources, collections, paginated objects and errors into a concise API response format.
Installation
Install the package via composer.
composer require stephenlake/laravel-shovel
Usage
Transform Post::paginate();
into
{
"meta": {
"status": "success",
"message": "OK",
"code": 200,
"pagination": {
"records": 42312,
"page": 1,
"pages": 2821,
"limit": 15
}
},
"data": [{...},{...},{...}]
}
Link:
This post is submitted by our members. Submit a new post.
Tags: Tutorials Laravel 5.7 Laravel 5.6 Laravel 5.5 Laravel 5.4 Laravel 5.3 Laravel 5 Intermediate