Looking to hire Laravel developers? Try LaraJobs

laravel-api-optimizer maintained by sakshsky

Description
A Laravel package to optimize API resources with sparse fieldsets, caching, and more.
Last update
2025/05/12 10:46 (dev-main)
License
Links
Downloads
0

Comments
comments powered by Disqus

Laravel API Resource Optimizer

Latest Version on Packagist Total Downloads License

Laravel API Resource Optimizer enhances Laravel's API Resource classes with advanced optimization features like sparse fieldsets, conditional relationship loading, and response caching, making your REST APIs faster and more flexible.

Features

  • Sparse Fieldsets: Request specific fields (e.g., GET /users?fields=id,name).
  • Conditional Relationship Loading: Include related data (e.g., GET /users?include=posts).
  • Response Caching: Cache API responses to reduce database queries.
  • Schema Validation: Validate requested fields and includes.
  • Rate-Limiting: Protect endpoints with throttling.

Requirements

  • PHP 8.0 or higher
  • Laravel 8.x, 9.x, or 10.x
  • Composer

Installation

Install via Composer:

composer require sakshsky/laravel-api-optimizer