Skip to content
This repository has been archived by the owner on Sep 16, 2019. It is now read-only.

pixelfusion/api-serializer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pixel Fusion API Serializer

NZ Love Awesomeness

This package provides a custom Serializer for Fractal that transforms data into the API output that we at Pixel Fusion prefer.

Installation

To install the latest version of this package run the following command:

composer require pixelfusion/api-serializer

After that you should change the serializer that you want to use to PixelFusion\Fractal\Serializer\ApiSerializer.

Output format

This API serializer extends the default ArraySerializer but has a slight difference. For the pagination we omitted the fields that we don't use. Below is an example of how a response that includes pagination will look like:

{
  "data": [
    {
      "id": "7ywpxp6r",
      "title": "The Godfather",
    },
    {
      "id": "q9pykp17",
      "title": "Pulp Fiction",
    }
  ],
  "pagination": {
    "total": 9,
    "per_page": 2,
    "current_page": 1,
    "last_page": 5
  }
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages