Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Short Url Bundle

Short Url Bundle Laravel Package

genj/short-url-bundle

genj/short-url-bundle is a Symfony bundle for adding short URL generation and redirection to PHP applications. It helps turn long links into compact, shareable addresses and route visitors to their original destinations with minimal configuration.

View on GitHub
Deep Wiki
Context7

Symfony Short Url bundle

Frequently asked questions about Short Url Bundle
What is genj/short-url-bundle used for, and does it work with Laravel?
It is a Symfony bundle for generating compact short URLs and redirecting short codes to destination URLs. It is not a Laravel package: there is no service provider, facade, publishable config, or Eloquent integration. Laravel teams can study the concept, but the bundle does not plug into Laravel's container, router, or middleware pipeline. The useful pattern is a slug lookup followed by an HTTP redirect, which is straightforward to build natively.
How do I install genj/short-url-bundle in a Laravel application?
You should not add it to a Laravel app's composer.json. Composer will either fail on symfony/framework-bundle version conflicts or install a parallel Symfony runtime that duplicates Laravel's HTTP kernel. There is no Laravel service provider to register or config to publish. Build a native short_urls table, model, controller, and redirect route instead.
Which Laravel and PHP versions does genj/short-url-bundle support?
None for Laravel. The last release was 2015-12-24 and the code targets Symfony 2.x and PHP 5.5/5.6 idioms, with no return types or nullable syntax expected by modern tooling. Modern Laravel requires PHP 8+ and current Symfony components only as transitive dependencies. The package is outside a supported Laravel version matrix, so there is no safe constraint to satisfy.
Is genj/short-url-bundle still maintained?
No. The repository is archived, the last release was 2015-12-24, and it has one star and zero dependents. Archived status means no CVE response and no fixes for open-redirect or dependency issues. For a production redirect layer, that maintenance gap is a high technical risk.
What are the best alternatives to genj/short-url-bundle for Laravel short URLs?
The lowest-risk alternative is a native Laravel implementation: a short_urls table, a ShortUrl Eloquent model, a resolve scope, a redirect controller or catch-all route, and queued hit counting. You can also evaluate maintained Laravel-specific short-link packages, but check Laravel version support, open-redirect protection, cache behavior, and 301 versus 302 semantics. Do not treat the Symfony bundle as a Laravel dependency.
How do I reimplement short URL generation and redirects natively in Laravel?
Create a short_urls table with slug, destination or polymorphic target_type and target_id, status_code, hits, and timestamps. Add a ShortUrl model with a resolve method, a single-action controller or {slug} catch-all that returns a RedirectResponse, and middleware or a queued job for hit counting. Cache slug-to-destination mappings in Redis with explicit invalidation when a target changes. Validate destination URLs to prevent open redirects and default to 302 unless a permanent redirect is intentional.
How is genj/short-url-bundle configured, and can I change redirect status codes?
The bundle uses Symfony's DI container and configuration conventions, not Laravel's config publishing. The available context does not confirm whether 301 versus 302 is configurable, and the TPM assessment flags that as an open question. Permanent 301 redirects are cached by browsers and are operationally hard to reverse, so verify behavior before relying on any redirect layer. In a Laravel reimplementation, make status_code explicit per short URL.
Is genj/short-url-bundle safe for production redirects?
No, not as a dependency in a modern Laravel production app. It has been archived since 2015 with no security response, and redirect layers are a classic open-redirect sink if destination validation is weak. The package also has essentially no field validation given its one star and zero dependents. Use it as a reference design only, not as a runtime dependency.
Can I fork genj/short-url-bundle and adapt it for Laravel?
You can legally fork it because it is MIT licensed, which is its cleanest signal. Practically, adapting it means translating Symfony DI to Laravel's container, Symfony routing to Laravel routes, Doctrine entities to Eloquent, and the event dispatcher to middleware or events. The redirect pattern itself is roughly 50 to 100 lines of Laravel code, so a clean reimplementation is usually less work. Fork only if you specifically want the reference implementation.
How do I test short URL redirects in a Laravel app?
Write feature tests that assert the redirect status and Location header for known slugs, 404 behavior for unknown slugs, and slug case sensitivity. Add tests for destination URL validation, self-redirects, soft-deleted targets, and slug collisions. If you count hits, assert the counter increments and that cache invalidation works after a destination update. Also test the 301 versus 302 choice because browser caching makes permanent redirects hard to undo.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core
nodisrupt/laravel-agent
sierratecnologia/media-manager