How to use Filament Api Service Plugin
Published onSeptember 29, 2023
941Views
1min read
1Comment
1Comment
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;
Tags:
phplaravelfilamenttutorial
1 Comment

Rupadana
•
Sep 29, 2023, 22:09
Hi, kindly leave a like and comment if you got new insight! 🔥