Download the PHP package sushidev/fairu-sdk without Composer
On this page you can find all versions of the php package sushidev/fairu-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package fairu-sdk
Fairu SDK for Laravel
A comprehensive Laravel SDK for the Fairu GraphQL API with dynamic fragments, caching, and full type support.
Requirements
- PHP 8.2+ (PHP 8.3+ for Laravel 13)
- Laravel 10, 11, 12, or 13
Installation
The package will auto-register its service provider and facade.
Publish Configuration
Configuration
Add the following to your .env file:
Full Configuration Options
Important: UUIDs
All IDs in the Fairu API are UUIDs (Universally Unique Identifiers). This applies to all resources:
- Assets
- Folders
- Galleries
- Copyrights
- Licenses
- Users
- Roles
- Disks
- Tenants
Example:
Basic Usage
Queries
Mutations
Fragments
Fragments allow you to customize which fields are returned from the API.
Predefined Fragments
Each resource type has three predefined variants: minimal, default, and full.
Custom Fragments with FragmentBuilder
Register Custom Fragments
Caching
The SDK supports Laravel's cache system for API responses.
DTOs (Data Transfer Objects)
All input types have fluent DTOs for type-safe data handling.
Response Objects
All API responses are wrapped in typed response objects.
Paginated Lists
Enums
All GraphQL enums are available as PHP 8.1 backed enums.
Error Handling
Events
The SDK dispatches events for debugging and logging.
Multipart Uploads
For large files, use multipart uploads.
File Proxy
The File Proxy provides image transformation and optimized file delivery.
Configuration
Basic Usage
Image Transformations
Video Features
Other Options
Skipping the visible watermark
If the tenant uses the visible watermark (logo overlay), server-rendered URLs can
skip it with withoutWatermark(). Pass the tenant's watermark key (fwm_...,
shown in the Fairu tenant settings). The SDK appends wm=0 and a signature
(wms) over the final query when the URL is built, so call order does not
matter. Removing wm=0/wms or changing any parameter of the URL brings the
watermark back.
Keep the key server-side; never build these URLs in the browser. An invalid
key throws an InvalidArgumentException.
Utility Methods
Available Parameters
| Parameter | Range | Description |
|---|---|---|
width |
1-6000 | Output width in pixels |
height |
1-6000 | Output height in pixels |
quality |
1-100 | JPEG/WebP quality (default: 95) |
format |
jpg, png, webp | Output format (default: webp) |
fit |
cover, contain | Resize mode (default: cover) |
focal |
x-y-zoom | Smart crop focal point |
wm / wms |
0 + signature |
Skip the visible watermark (set via withoutWatermark()) |
Testing
License
MIT License. See LICENSE for details.
All versions of fairu-sdk with dependencies
guzzlehttp/guzzle Version ^7.0
illuminate/support Version ^10.0|^11.0|^12.0|^13.0
illuminate/contracts Version ^10.0|^11.0|^12.0|^13.0
illuminate/cache Version ^10.0|^11.0|^12.0|^13.0