Download the PHP package sarfrazrizwan/laravel-webling without Composer
On this page you can find all versions of the php package sarfrazrizwan/laravel-webling. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sarfrazrizwan/laravel-webling
More information about sarfrazrizwan/laravel-webling
Files in sarfrazrizwan/laravel-webling
Package laravel-webling
Short Description An ergonomic Laravel wrapper for the Webling REST API featuring automated caching, credentials validation, robust API key redaction, and type-safe resource groups.
License MIT
Homepage https://github.com/sarfrazrizwan/laravel-webling
Informations about the package laravel-webling
Laravel Webling Wrapper Package
Laravel wrapper for the Webling REST API (usystems/webling-api-php). It features a three-layer architecture (raw pass-through, ergonomic resource models, and read-only singletons), credentials validation, automated caching, and robust API key security redacting.
Installation
You can install the package via composer:
You can publish the configuration file using:
Configuration
Set the environment variables in your .env file:
Usage
You can access the package using dependency injection or through the Webling facade:
Layer 1: Raw HTTP Pass-through (Escape Hatch)
Thin methods returning decoded arrays and throwing WeblingApiException on HTTP status codes >= 400. Useful for endpoints not modeled by the resource layer.
Layer 2: Ergonomic Resource Groups
Named accessors mapping to Webling object types. Resource instances are cached in memory for the duration of the request.
Specialized Subclass Endpoints
-
member: Adds binary downloads -
article: Adds image download -
document: Adds document content and head checks -
documentgroup: Adds archive ZIP download -
apikey: Fetch last used details user: Trigger onboarding
Note: All binary sub-resources return raw bytes (strings) rather than JSON arrays.
Layer 3: Singletons and Read-Only Direct Methods
Direct methods for singleton routes:
Caching Integration
If WEBLING_CACHE_ENABLED is true, you can retrieve the cache instance wrapper:
Error Handling
All failed HTTP requests (status >= 400) throw a WeblingApiException which carries detailed request metadata. For security, the API key is automatically redacted from any exception messages and printed stack traces.
Testing
Mocking requests is simple by swapping the bound Client singleton instance:
Run test suite:
References
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-webling with dependencies
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^10.0|^11.0|^12.0|^13.0
usystems/webling-api-php Version ^1.3