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 Trailing Slash Laravel Package

illuminatech/url-trailing-slash

Laravel middleware that enforces consistent trailing slashes by redirecting requests to the canonical URL form. Avoid duplicate-content SEO issues and keep links predictable, with flexible per-route configuration for when a trailing slash should or shouldn't appear.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • SEO canonicalization / duplicate-content cleanup. /pricing and /pricing/ are two URLs to search engines. Deciding on one canonical form and enforcing it (via 301 redirect) is a concrete SEO hygiene decision this package executes; it supports the question "do we have a URL normalization policy, and is it enforced?"
  • Roadmap trade-off: build vs. buy. A trailing-slash normalization middleware is ~40–80 lines of Laravel code. This package exists at that exact seam — the decision it informs is whether to own a small piece of routing plumbing or take a dependency. For a small, stable concern, "buy" (adopt) only makes sense if the package is trustworthy; otherwise "build" is trivially cheap.
  • Feature scope for legacy migrations. When moving from a legacy CMS/app where URLs had inconsistent trailing slashes, this package provides redirect-based normalization, letting you decide which direction to standardize (with or without slash) without touching every route definition or view template.
  • Cache/CDN and analytics hygiene. Consistent URLs mean fewer cache keys and cleaner traffic attribution. This supports decisions about whether to normalize upstream (CDN/WAF) or inside the app.
  • API vs. web surface differentiation. Trailing-slash enforcement is usually a web/SEO concern, not an API concern. It informs scoping decisions: which route groups get normalization applied and which are exempt.

When to Consider This Package

Adopt when:

  • You're on Laravel and want per-route-group, configurable enforcement (force trailing slash or forbid it) with redirect behavior.
  • You have a real, measurable duplicate-URL problem — e.g., audit data showing both variants indexed or split analytics.
  • You need the behavior fast and don't want to hand-roll redirect logic (including preserving query strings and method semantics).

Look elsewhere / build it yourself when:

  • License is a blocker. NOASSERTION is not a recognized permissive license. Before adopting, legal must confirm terms; if unclear, treat it as un-adoptable until resolved. This is the single biggest adoption risk here.
  • Maintenance signal is weak. 49 stars is small for a security-adjacent routing component. Check last commit, open issues, and Laravel version compatibility against your target version before committing.
  • Your need is narrow. If you only need a global "redirect /foo/ → /foo", a tiny middleware or web-server rule is lower risk and zero-dependency.
  • The problem can be solved upstream. Nginx/Apache or CDN rules may handle this more cheaply and cover non-Laravel services too.
  • You need richer URL policies (locale prefixes, case normalization, uppercase-to-lowercase, multi-segment canonicalization) — this package targets trailing slashes specifically, not general URL normalization.

How to Pitch It (Stakeholders)

For executives: This is a small, low-cost piece of SEO hygiene. It ensures each page has exactly one canonical URL rather than two, which protects search ranking and keeps our analytics and caching clean. It's not a feature users see; it's plumbing that prevents a common class of avoidable SEO and reporting noise. The only real risk is governance — the package's license is unclassified, so legal sign-off is required before we make it a dependency.

For engineering: A Laravel middleware that normalizes trailing slashes on routes and 301-redirects the non-canonical form, configurable per route group (force-with or force-without). It's roughly a day of trivial in-house work, so the adoption case rests on convenience, not capability. Recommend a short spike: confirm license terms, check Laravel version support and recent commit activity, then decide package vs. ~60 lines of middleware. If the license stays ambiguous, build it in-house — the implementation is small and the maintenance burden is negligible either way.

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.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console