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

Url Bundle Laravel Package

kematjaya/url-bundle

A lightweight PHP package for generating, parsing, validating, and managing URLs. It offers a simple API to centralize link handling, reduce repetitive string manipulation, and integrate cleanly into existing PHP or Laravel projects.

View on GitHub
Deep Wiki
Context7

Getting Started

This is a Symfony bundle, not a Laravel package — there is no ServiceProvider, no config/url-bundle.php, and no php artisan integration. If you are coming from Laravel, treat this as "a third-party Symfony library you may need to bridge into a Laravel app," and budget accordingly.

Minimal steps:

  1. Read the source before installing. With 3 stars and 0 dependents, the README is likely thin — the authoritative docs are src/DependencyInjection/*Extension.php, src/Resources/config/services.yaml, and the src/Entity/ directory. Check what the bundle actually claims: the name suggests URL storage/management (possibly shortening or route-to-URL mapping), but confirm against the entity fields.
  2. Check compatibility. Look at composer.json for the symfony/* version constraints. A low-traffic bundle is often pinned to Symfony 4/5 and will not install on a modern Symfony 7 app without a conflict.
  3. Install in a Symfony host app first (not Laravel) to see it work:
    composer require kematjaya/url-bundle
    
  4. Register the bundle in config/bundles.php:
    Kematjaya\URLBundle\URLBundle::class => ['all' => true],
    
  5. First use case: the most likely minimal path is — create the entity schema (php artisan-equivalent is bin/console doctrine:migrations:diff then doctrine:migrations:migrate), inject the bundle's service or repository into a controller, and persist one URL record. That single round-trip validates the DI wiring, the Doctrine mapping, and the table name in one shot.

If the bundle's service wiring fails at container compile time on a modern Symfony, stop — that is your signal the package is not viable for your stack without forking.

Implementation Patterns

Entity-first usage. Most small kematjaya bundles follow a Doctrine-entity-plus-repository pattern. The intended workflow is:

  • Persist via the entity's setters and EntityManager::flush().
  • Query via the bundle's *Repository class rather than writing raw DQL, so you stay on the supported path.
  • If the bundle exposes a service (e.g. a manager or factory), prefer it over instantiating entities yourself — it may enforce validation or slug/URL normalization.

Service injection. Register your consumer as a normal Symfony service and let autowiring pull the bundle's manager in:

public function __construct(private UrlManager $urlManager) {}

If autowiring fails, the bundle probably did not alias its interface — declare the binding explicitly in config/services.yaml.

Laravel bridging pattern. If you must use it inside Laravel:

  • Do not expect the bundle to boot. Symfony bundles rely on Kernel::registerBundles(), which Laravel has no equivalent for.
  • The realistic integration is to extract the entity + repository logic and wire the Doctrine ORM manually against Laravel's doctrine/dbal, or run a Symfony micro-kernel and call it out-of-process. Both are more work than reimplementing the URL model directly (it is usually a handful of columns).

Schema ownership. Prefer generating your own migration from the bundle's entity mapping rather than relying on any bundled migrations. This lets you control indexes (put a unique index on the URL/route column) and avoids the bundle shipping a migration that targets the wrong table prefix.

Read paths. For anything hot (redirect lookups), wrap the repository in your own caching decorator. A 3-star bundle will not ship a cache layer, and URL-to-entity lookups are exactly the kind of query you want in Redis.

Gotchas and Tips

  • It is not a Laravel package. The strongest gotcha. No auto-discovery, no facade, no config publish. Everything is manual Symfony wiring, or a bridge you write yourself.
  • Maintenance risk is the headline. 3 stars, 0 dependents, score ~0.015 — assume no security patches and no Symfony 7 support unless the composer.json proves otherwise. Fork it into your VCS (or vendor it under packages/ with a path repository) before shipping to production.
  • Version-pin hard. Use an exact constraint ("kematjaya/url-bundle": "1.0.3"), not ^1.0. A single-tag repo can be force-pushed or re-tagged, and Composer will happily resolve to a broken commit.
  • Doctrine mapping mismatches. Small bundles often annotate entities for one Doctrine version. If you see MappingException or "The table with name ... already exists," inspect the entity's #[ORM\Table] / @ORM\Table attributes and override rather than migrate blindly.
  • Container compile errors are your best debugging signal. Run bin/console cache:clear and read the full InvalidArgumentException/ServiceNotFoundException — it names the missing service ID, which usually tells you which alias to add in services.yaml.
  • No test suite means you write the tests. Smoke-test the bundle's core service with a functional test (KernelTestCase) before you build on it. If there is no tests/ directory in the repo, that is a real risk, not a nitpick.
  • Extension points are minimal. Expect to extend via your own decorator service or by extending the entity class — not via events or config. Check DependencyInjection/Configuration.php for what is actually configurable before assuming there is a knob.
  • Alternatives worth a look if your goal is URL shortening or slug management: hashids/hashids for short IDs, cocur/slugify for slugs, or a ~50-line custom Doctrine entity — each is better supported than this bundle and removes the Symfony-in-Laravel friction entirely.

Bottom line: usable only in a Symfony app that matches its version constraints, and only after forking and smoke-testing it. For a Laravel codebase, the pragmatic call is to reimplement the (likely small) URL model yourself and skip the bundle.

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.
coleus/frame
thtg88/journalism
filagora/filagora-ai-forums
rlacerda83/query-parser
socialdept/atp-orm
cboxdk/laravel-assistant-client
socialdept/atp-resolver
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings