nzo/url-encryptor-bundle
Symfony bundle for encrypting and decrypting URL parameters, helping hide sensitive IDs and create tamper-resistant links. Integrates with Symfony routing so you can generate and resolve encrypted URLs with minimal configuration.
composer require nzo/url-encryptor-bundle. This is a Symfony bundle, not a Laravel package. In a Symfony app, register it in config/bundles.php, set the secret/key in .env, and configure config/packages/nzo_url_encryptor.yaml.DependencyInjection configuration. Identify the service class (usually Nzo\UrlEncryptorBundle\UrlEncryptor\UrlEncryptor) and the cipher/key options. That service is what you would port or wrap if you need the behavior in Laravel.Crypt::encryptString($id) / Crypt::decryptString($encrypted), orUrlIdEncryptor service, or$encrypted = Crypt::encryptString($user->id);
$url = route('users.show', ['user' => $encrypted]);
// Controller
$id = Crypt::decryptString($request->route('user'));
For tamper-proof URLs with expiry, prefer URL::signedRoute() / URL::temporarySignedRoute() before reaching for a third-party encryptor.encrypt()/decrypt() calls across controllers. Create App\Support\UrlIdEncryptor with encryptId() and decryptId() methods. In Symfony, inject the bundle service into that adapter; in Laravel, bind your ported implementation in a service provider.@encryptedRoute('users.show', $user->id), backed by your adapter. Do not attempt to load the Symfony bundle’s service definitions in Laravel.['id' => 123, 'exp' => now()->addHour()->timestamp], then validate expiry after decryption. This mirrors signed URLs but gives you opaque ciphertext instead of a visible signature.+// with URL-safe -/_ will produce intermittent decrypt exceptions.404 or 400 rather than letting a malformed token produce a 500. Do not leak whether the ciphertext was tampered with or the key was wrong.bin/console or artisan tinker), verify the key is actually loaded, and log only a ciphertext prefix — never the plaintext or full key.final, port the logic instead of extending it.How can I help you explore Laravel packages today?