PHPackages                             praman-codelab/self-healing-url - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. praman-codelab/self-healing-url

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

praman-codelab/self-healing-url
===============================

Laravel package for self-healing URLs: typo correction, normalization, smart fallback.

01PHP

Since Sep 30Pushed 7mo agoCompare

[ Source](https://github.com/pratikraman-dev/Self-Healing-URL)[ Packagist](https://packagist.org/packages/praman-codelab/self-healing-url)[ RSS](/packages/praman-codelab-self-healing-url/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel Self-Healing URLs
=========================

[](#laravel-self-healing-urls)

Automatically normalizes URLs and fixes common typos in Laravel applications.

Features
--------

[](#features)

- Normalize URLs (lowercase, remove trailing slash)
- Fuzzy redirects for static routes
- Corrects parameterized routes
- SEO-friendly 301 redirects
- Configurable Levenshtein thresholds

---

Installation
------------

[](#installation)

Require the package via Composer:

```
composer require praman-codelab/self-healing-url:dev-main
```

> Note: During development, you can use `dev-main`. For stable releases, replace with a version tag (e.g., `^1.0`).

---

Middleware Setup
----------------

[](#middleware-setup)

Add the middleware to `app/Http/Kernel.php` under the `web` group:

```
protected $middlewareGroups = [
    'web' => [
        \Bala\SelfHealingUrl\Middleware\NormalizeUrl::class,
        // other middlewares...
    ],
];
```

This ensures URLs are normalized before routing.

---

Config
------

[](#config)

Publish the package configuration:

```
php artisan vendor:publish --tag=config
```

Then adjust thresholds in `config/selfhealing.php`:

```
return [
    'static_distance' => 3, // max typo distance for static routes
    'param_distance' => 2,  // max typo distance for parameterized routes
];
```

---

Usage Examples
--------------

[](#usage-examples)

- Misspelled static URL:

```
/abut-us → /about-us

```

- Misspelled parameterized URL:

```
/produts/123 → /products/123

```

- If no close match is found, Laravel returns a standard 404 page.

---

License
-------

[](#license)

MIT

---

Publishing Steps for Packagist
------------------------------

[](#publishing-steps-for-packagist)

1. Create a GitHub repository and push your package folder.
2. Tag a stable version:

```
git tag v1.0.0
git push origin v1.0.0
```

3. Submit your repository to [Packagist.org](https://packagist.org/packages/submit).
4. Optionally, set up the GitHub webhook for automatic updates:

- **Payload URL:** `https://packagist.org/api/github?username=YOUR_PACKAGIST_USERNAME`
- **Content Type:** `application/json`
- **Secret:** your Packagist API token
- **Events:** push events only

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance44

Moderate activity, may be stable

Popularity1

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity13

Early-stage or recently created project

 Bus Factor1

Top contributor holds 75% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/24254229b152d26a7b295788c587e01646539f8266940a7e27bfde308e9b00b4?d=identicon)[praman](/maintainers/praman)

---

Top Contributors

[![pratikraman1305](https://avatars.githubusercontent.com/u/97603714?v=4)](https://github.com/pratikraman1305 "pratikraman1305 (6 commits)")[![pratikraman-dev](https://avatars.githubusercontent.com/u/8825570?v=4)](https://github.com/pratikraman-dev "pratikraman-dev (2 commits)")

### Embed Badge

![Health badge](/badges/praman-codelab-self-healing-url/health.svg)

```
[![Health](https://phpackages.com/badges/praman-codelab-self-healing-url/health.svg)](https://phpackages.com/packages/praman-codelab-self-healing-url)
```

###  Alternatives

[grumpydictator/firefly-iii

Firefly III: a personal finances manager.

22.8k69.3k](/packages/grumpydictator-firefly-iii)[wnx/laravel-stats

Get insights about your Laravel Project

1.8k1.8M7](/packages/wnx-laravel-stats)[php-mqtt/laravel-client

A wrapper for the php-mqtt/client library for Laravel.

228539.3k1](/packages/php-mqtt-laravel-client)[pdmfc/nova-info-card

A Laravel Nova info card.

14103.0k2](/packages/pdmfc-nova-info-card)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
