snow-digital / laravel-json-api
Installs: 650
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/snow-digital/laravel-json-api
Requires
- php: ^8.2
- spatie/laravel-json-api-paginate: ^1.12.2
- spatie/laravel-package-tools: ^1.11
- spatie/laravel-query-builder: ^6.0
Requires (Dev)
- nunomaduro/larastan: ^2.0
- orchestra/testbench: ^7.0|^8.0
README
This package allows to quickly prototype a JSON:API API, automatizing most of it from Eloquent or QueryBuilder.
It's based on top of Spatie Query Builder and JSON Api Paginate, allowing to easily switch when you need more flexibility without having to rework everything.
Installation
You can install the package via composer:
composer require snow-digital/laravel-json-api
Optionally you can publish the config file with:
php artisan vendor:publish --tag=json-api-config
Usage
If you are using Laravel default structure, you don't need to do anything else. It will detect and register automatically all Eloquent Models as resources.
You can check if the routes are registered correclty using:
php artisan route:list --name=json-api