Filament API Service

A simple api service for supporting filamentphp

Filament API Service

Installation

You can install the package via composer:

Usage

Add this code to your routes file, example in routes/api.php
and then you will got this routes:
  • [GET] '/api/blogs' - Return LengthAwarePaginator
  • [GET] '/api/blogs/1' - Return single resource
  • [PUT] '/api/blogs/1' - Update resource
  • [DELETE] '/api/blogs/1' - Delete resource
Im using
to handle query and filtering. u can see
https://spatie.be/docs/laravel-query-builder/v5/introduction
You can specified
and
in your model
Example

Transform API Response

it will be create BlogTransformer in
next step you need to edit & add it to your Resource

Group Name & Prefix

You can edit prefix & group route name as you want, default im use model singular label;