packaged/thrift
Laravel package for generating and running Apache Thrift services. Provides artisan commands and tooling to compile IDL, organize generated PHP code, and integrate Thrift clients/servers into your app for fast, typed RPC between services.
Pros:
.thrift IDL (Interface Definition Language) enforces strict contracts, reducing runtime errors in distributed systems.Cons:
thrift:make Artisan commands or Eloquent-like ORM).packaged/thrift package likely wraps the PHP Thrift library, which is stable but requires manual setup (e.g., protocol buffers, transport layers).TAsyncClient) could complement Laravel Queues for background processing, but this is non-trivial to implement.tdebug or custom logging middleware would be needed..thrift updates)./thrift/UserService) alongside existing REST./thrift/* to a PHP-FPM process running Thrift.// routes/thrift.php
$server = new \Thrift\Server\THttpServer(
new \Thrift\Processor\TMultiplexedProcessor([
new \UserService\Processor(new \UserService\Handler()),
]),
new \Thrift\Transport\THttpServerTransport(8080)
);
$server->serve();
8080) and proxy requests.thrift --gen + unit tests).ext-protobuf or other binary protocol extensions.| Step | Task | Tools/Dependencies |
|---|---|---|
| 1. Setup | Install packaged/thrift and dependencies (ext-thrift). |
Composer, Docker (for isolation) |
| 2. Schema Design | Define .thrift files for services. |
VS Code + Thrift Language Server |
| 3. Codegen | Generate PHP classes from .thrift. |
thrift --gen php |
| 4. Service Layer | Implement Thrift handlers (e.g., UserServiceHandler). |
Laravel Services pattern |
| 5. Proxy Config | Configure Nginx/Envoy to route /thrift/* to Thrift server. |
Nginx, Envoy |
| 6. Client Integration | Update internal clients to use Thrift. | Custom Thrift clients |
| 7. Monitoring | Add logging/metrics for Thrift calls. | Laravel Telescope, Prometheus |
| 8. Deprecation | Phase out REST endpoints (if applicable). | Feature flags, deprecation headers |
thrift, tcompile) for codegen and validation..thrift files being up-to-date in CI/CD.tcpdump, custom log formatters).TException) don’t map cleanly to Laravel’s Illuminate\Support\MessageBag..thrift files.TTransportException").How can I help you explore Laravel packages today?