factory/infra (0.2.1)
Published 2026-08-06 01:35:39 +00:00 by bmiadmin
Installation
{
"repositories": [{
"type": "composer",
"url": " "
}
]
}composer require factory/infra:0.2.1About this package
SaaS Factory infra: API envelope, pagination, idempotency keys, request-ID logging, health endpoint, rate limits.
factory/infra — v0.1.0
Cross-cutting HTTP infrastructure for every product API.
Provides
- Response envelope —
Http\ApiResponse:ok()/paginate()→{ok, data, meta}for collections,item()→ flat JSON for single created/fetched resources (the factory_core client readsid/referencefrom the top level of the POST body — never wrap those),fail()→{ok:false, message, errors}.
- Idempotency —
factory.idempotencymiddleware: caches the response of a successful mutating request perIdempotency-Key(which factory_core sends on every POST) forinfra.idempotency_ttl_hours; retries replay, never double-book. - Request-ID + structured logging —
factory.request-idmiddleware: honours or mintsX-Request-Id, adds it (plus method/path/product) to the log context and the response. - Rate limits — named limiters
factory-api/factory-writes(configinfra.rate_limits, envFACTORY_RATE_API/FACTORY_RATE_WRITES). - Health —
GET /api/health→ app, time, db reachability (503 when degraded).
Endpoints
| Method | Path | Purpose |
|---|---|---|
| GET | /api/health | Liveness/readiness for ops + probes |
Config
config/infra.php — rate limits, idempotency TTL. Requires a cache store
(file cache is fine for the blueprint).
Dependencies
Dependencies
| ID | Version |
|---|---|
| factory/kernel | ^0.2 || ^0.3 || ^0.4 || ^0.5 || ^0.6 || ^0.7 || ^0.8 || ^0.9 |
| illuminate/http | ^10.0 || ^11.0 || ^12.0 || ^13.0 |
| illuminate/routing | ^10.0 || ^11.0 || ^12.0 || ^13.0 |
| illuminate/support | ^10.0 || ^11.0 || ^12.0 || ^13.0 |
| php | ^8.2 |
Development dependencies
| ID | Version |
|---|---|
| orchestra/testbench | ^8.0 || ^9.0 || ^10.0 || ^11.0 |
| phpunit/phpunit | ^10.1 || ^11.0 || ^12.0 |
Details
2026-08-06 01:35:39 +00:00
Assets (1)
Versions (3)
View all
Composer
54
proprietary
20 KiB
factory-infra.0.2.1.zip
20 KiB