Download the PHP package rerout/laravel without Composer
On this page you can find all versions of the php package rerout/laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download rerout/laravel
More information about rerout/laravel
Files in rerout/laravel
Package laravel
Short Description Laravel integration for the Rerout branded-link API — service provider, facade, config, webhook controller, and events.
License MIT
Homepage https://rerout.co
Informations about the package laravel
rerout/laravel
Laravel integration for the Rerout API.
Wraps rerout/sdk with a service
provider, facade, config file, a webhook controller, and Laravel events — so
short links, QR codes, analytics, and webhooks feel native in a Laravel app.
Install
Requires PHP 8.2+ and Laravel 10, 11, or 12. The package auto-registers its
service provider and the Rerout facade via Laravel package discovery.
Publish the config file if you want to tweak defaults:
Configuration
Set these in your .env:
The published config/rerout.php also exposes the webhook tolerance window
and route settings — see the file's inline comments.
Usage
The client
The service provider binds a shared Rerout\Rerout singleton. Resolve it any
way Laravel allows — constructor injection, the container, or the facade.
Constructor injection works too:
The full client surface — links(), project(), qr() — is documented in
the base SDK README.
Verifying the API key
Calls GET /v1/projects/me and prints the resolved project. Exits non-zero on
any API failure — handy for deploy smoke tests.
Webhooks
The package registers a POST route (default rerout/webhook, named
rerout.webhook) backed by a controller that:
- verifies the
X-Rerout-Signatureheader againstREROUT_WEBHOOK_SECRET, - returns 401 on a missing/invalid/expired signature,
- returns 400 on a body that is not a JSON object,
- dispatches a Laravel event and returns 200 otherwise.
Point your Rerout webhook endpoint at https://your-app.test/rerout/webhook.
Disable the bundled route (to mount the controller yourself) by setting
REROUT_WEBHOOK_ROUTE_ENABLED=false, or change the path with
REROUT_WEBHOOK_ROUTE_PATH.
Listen for the events:
Webhook type |
Event |
|---|---|
link.clicked |
Rerout\Laravel\Events\LinkClicked |
qr.scanned |
Rerout\Laravel\Events\QrScanned |
domain.failed |
Rerout\Laravel\Events\DomainFailed |
Each event carries the full decoded payload in its readonly $payload
property. Unknown event types still return 200 but dispatch nothing.
Error handling
Every client call throws Rerout\Exceptions\ReroutException on failure, with
a stable code(), HTTP status(), and isRateLimited() / isServerError()
flags. See the base SDK README
for the full list of error codes.
Local development
The composer.json includes a path repository pointing at ../php, so the
package builds against the local rerout/sdk checkout inside this workspace.
License
MIT — see LICENSE.
Links
All versions of laravel with dependencies
rerout/sdk Version ^0.2 || ^0.3
illuminate/support Version ^10.0 || ^11.0 || ^12.0
illuminate/http Version ^10.0 || ^11.0 || ^12.0