Download the PHP package vitisstudio/restdb without Composer
On this page you can find all versions of the php package vitisstudio/restdb. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download vitisstudio/restdb
More information about vitisstudio/restdb
Files in vitisstudio/restdb
Package restdb
Short Description RestDB — an Eloquent database driver for RESTful APIs
License MIT
Homepage https://github.com/VitisStudio/laravel-restdb-driver
Informations about the package restdb
vitisstudio/restdb
The core of the RestDB Eloquent driver: register the restdb database driver
and talk to any RESTful API through Eloquent, within the capabilities the
connection declares.
What you get:
- A gated query builder: declared capabilities work, everything else throws at your line with the fix in the message. SQL-only surface (joins, raw, locks, transactions, schema) always throws. Two-phase enforcement catches wheres injected by scopes and packages — nothing is ever silently dropped.
- Primary-key equality is identity targeting (
find,save,delete) and never requires filter capabilities. - Reads: page-drain loop with a
max_pagesguard that throws instead of truncating;cursor()/lazy()stream one page at a time; one-requestpaginate()over meta totals;whereHasdecomposition with a key cap. - Writes: POST / dirty-only PATCH / DELETE against a single resource by key;
models re-fill from the server's response; 422 maps to Laravel's
ValidationException. - Auth:
none,basic,bearer,api_key,oauth2_client_credentials,oauth2_refresh_token(cached, lock-guarded, 401-refresh-retry-once), or any class-stringAuthenticator. No static state — Octane-safe. Http::fake()works everywhere;DB::listen/Telescope see real request lines with real timing.- Throttling:
429/503responses retry on their own budget, honoringRetry-After(delta-seconds or HTTP-date) and falling back to exponential backoff, every wait capped bymax_wait. Exhaustion throws a typedRestDBThrottledExceptionso callers can tell "busy, reschedule" from a real failure.
HTTP middleware — caching, rate limiting, logging
The driver deliberately does not own a response cache or a rate limiter.
Instead it exposes the underlying Laravel/Guzzle HTTP client so you register
whatever middleware you need. List their class names under http.middleware;
each is resolved from the container and applied to every request in order:
Each class must resolve to an invokable Guzzle handler-stack middleware
(fn (callable $handler): callable); a class that isn't callable is a
configuration error surfaced when the connection is built. Http::fake() and
DB::listen still see the requests. Because entries are class-strings resolved
from the container, wrap any middleware that needs constructor arguments (a TTL,
a rate) in a small class — as both examples below do.
Rate limiting
spatie/guzzle-rate-limiter-middleware
sleeps until the next request is allowed, per second or per minute:
Response caching
kevinrob/guzzle-cache-middleware
is RFC 7234-aware and Laravel-cache backed. Its GreedyCacheStrategy gives a
plain TTL cache for REST APIs that send no cache headers:
Neither package is a dependency of the driver — install only what a connection needs. The driver supplies the seam; the policy is yours.
For JSON:API backends, install
vitisstudio/restdb-jsonapi instead of
writing a compiler/parser by hand.
All versions of restdb with dependencies
illuminate/contracts Version ^12.0||^13.0
illuminate/database Version ^12.0||^13.0
illuminate/http Version ^12.0||^13.0
spatie/laravel-package-tools Version ^1.16
vitisstudio/restdb-contracts Version ^0.1