maillotf/papercut-bridge-bundle
A Symfony bundle that bridges Papercut into Symfony applications, providing service wiring and configuration to simplify integration. Use it to connect Papercut functionality with your Symfony project and reduce manual setup.
maillotf/papercut-bridge-bundle is a Symfony bundle, not a Laravel package, so there is no package auto-discovery, no publishable config, and no facade. Treat it as a thin wrapper around a Papercut XML-RPC client that you wire into Laravel yourself.
composer require maillotf/papercut-bridge-bundle
MaillotF\Papercut\PapercutBridgeBundle\Service\PapercutService. It exposes the underlying client through public properties (e.g. $ps->user, $ps->printJob, etc.); that object graph is the real API surface you will use.config/papercut.php:
return [
'authentication' => [
'protocol' => env('PAPERCUT_PROTOCOL', 'http'),
'host' => env('PAPERCUT_HOST', '127.0.0.1'),
'port' => env('PAPERCUT_PORT', '80'),
'path' => env('PAPERCUT_PATH', '/rpc/api/xmlrpc'),
'token' => env('PAPERCUT_TOKEN'),
],
];
AppServiceProvider::register():
$this->app->singleton(PapercutService::class, function ($app) {
return new PapercutService($app['config']->get('papercut'));
});
public function show(PapercutService $ps, string $id)
{
return response()->json($ps->user->getUser($id)->getEmail());
}
php artisan tinker before building anything on top; a bad token or path fails at call time, not construction time.PapercutService, not the underlying client. In controllers, queued jobs, console commands, and scheduled tasks, type-hint the service and let the container resolve it. Prefer constructor injection in jobs/commands so serialization stays clean.App\Contracts\PapercutClient and have PapercutService satisfy it (or an adapter implement it). This gives you a seam to swap in a fake during tests and insulates the app from the bundle's public-property API.protocol/host/port/path combination or a single full path URL. Standardize on one in config/papercut.php and document it so nobody mixes the two styles.$ps->user->getUser($knownId)) and reports pass/fail — useful in deploy pipelines and on-call runbooks.TestCase, swap the contract binding for a fake returning stub user objects, so feature tests never touch a live Papercut server.php artisan vendor:publish, config/*.php auto-merge, or alias registration. If the service constructor signature doesn't match the array you pass, you'll get a TypeError at resolution time — read the bundle's Service/PapercutService.php before wiring.framework.yaml. Laravel has no framework.yaml and no Symfony service container in this sense. The services.yaml snippet in the docs is Symfony-only.path (full URL) with protocol/host/port can silently produce a malformed endpoint. protocol/port are strings in the docs — keep them as strings in your config array to match the expected shape.PAPERCUT_TOKEN in .env/secret manager, add it to .env.example empty, and never log request payloads containing it. Verify with php artisan config:clear after changing env vars — cached config is the most common "it worked in tinker but not in the app" cause.getEmail(), etc.), not arrays. Don't toArray() them expecting array access; check the underlying client class for available getters.$ps->user). This is convenient but brittle — an upstream rename breaks call sites silently. Funnel access through your adapter so upgrades touch one file.papercut.service in the container. Use Laravel's container binding — bind the concrete to an interface, then extend via decorator if you need logging, metrics, or caching around calls.path including /rpc/api/xmlrpc, reachable host/port from the container, valid token, user ID sent as a string, and the Papercut server's XML-RPC endpoint enabled. Log one raw request/response pair when first integrating.How can I help you explore Laravel packages today?