PHPackages                             aurawindsurfing/slashremovemiddleware - 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. aurawindsurfing/slashremovemiddleware

ActiveLibrary

aurawindsurfing/slashremovemiddleware
=====================================

This package adds 301 redirect to all routes with trailing slashes.

v1.0.4(3y ago)138MITPHP

Since Jan 22Pushed 3y ago1 watchersCompare

[ Source](https://github.com/aurawindsurfing/slashremovemiddleware)[ Packagist](https://packagist.org/packages/aurawindsurfing/slashremovemiddleware)[ Docs](https://github.com/aurawindsurfing/slashremovemiddleware)[ RSS](/packages/aurawindsurfing-slashremovemiddleware/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (3)Versions (6)Used By (0)

SlashRemoveMiddleware
=====================

[](#slashremovemiddleware)

[![Latest Stable Version](https://camo.githubusercontent.com/2a934803d7b86773847625b720ce3cc0f247c372e0019eb7be3f55c61ddb92bb/687474703a2f2f706f7365722e707567782e6f72672f6175726177696e6473757266696e672f736c61736872656d6f76656d6964646c65776172652f76)](https://packagist.org/packages/aurawindsurfing/slashremovemiddleware) [![Total Downloads](https://camo.githubusercontent.com/544ca87a98d3fada7eeddad25c53972c9951363e144e65cac61096cdb4ec3a6f/687474703a2f2f706f7365722e707567782e6f72672f6175726177696e6473757266696e672f736c61736872656d6f76656d6964646c65776172652f646f776e6c6f616473)](https://packagist.org/packages/aurawindsurfing/slashremovemiddleware) [![Latest Unstable Version](https://camo.githubusercontent.com/ce91d2e4756e17bca6140929e514be7b4092b908c7f8ca9a92bbf1145dd980de/687474703a2f2f706f7365722e707567782e6f72672f6175726177696e6473757266696e672f736c61736872656d6f76656d6964646c65776172652f762f756e737461626c65)](https://packagist.org/packages/aurawindsurfing/slashremovemiddleware) [![License](https://camo.githubusercontent.com/63c97dc8b9fa8379c471302f0208d14fcb2c61998255da5edf054d8fd9224a1d/687474703a2f2f706f7365722e707567782e6f72672f6175726177696e6473757266696e672f736c61736872656d6f76656d6964646c65776172652f6c6963656e7365)](https://packagist.org/packages/aurawindsurfing/slashremovemiddleware) [![PHP Version Require](https://camo.githubusercontent.com/deb3dae1320ddbe0c630ece173af4b99e369a3270bcda6e59fac515dea89e0a2/687474703a2f2f706f7365722e707567782e6f72672f6175726177696e6473757266696e672f736c61736872656d6f76656d6964646c65776172652f726571756972652f706870)](https://packagist.org/packages/aurawindsurfing/slashremovemiddleware)

It is important to remove trailing slashed from applications made with laravel and it is bad for SEO as Google will index your page twice, once with slash and once without it. The correct behaviour is to create 301 for ever page with trailing slash to avoid content duplication in search results.

Here is the source:

Before you start
----------------

[](#before-you-start)

An easy way to check if your app is behaving properly is to create a test route in `routes/web.php` like this:

```
Route::get('/foobar', function () {
    return 'simple test';
});

```

Then visit this endpoint with trailing slash `yourapp.test/foobar/`

If "simple test" was displayed and trailing slash did not dissapear from your url in the browser window then Google will not be happy about it and you need to fix it.

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

[](#installation)

Via Composer

```
composer require aurawindsurfing/slashremovemiddleware
```

Usage
-----

[](#usage)

This package will auto register itself in Laravel 6 and higher.

Now repeat the same test.

You should be redirected to the same url but without trailing slash `yourapp.test/foobar` and see the same text.

Now Google will only index every page once.

Change log
----------

[](#change-log)

Please see the [changelog](changelog.md) for more information on what has changed recently.

Testing
-------

[](#testing)

```
composer test
```

Contributing
------------

[](#contributing)

Please see [contributing.md](contributing.md) for details and a todolist.

Security
--------

[](#security)

If you discover any security related issues, please email author email instead of using the issue tracker.

Credits
-------

[](#credits)

- [Tomasz Lotocki](https://github.com/aurawindsurfing)
- [All Contributors](../../contributors)

License
-------

[](#license)

license. Please see the [license file](license.md) for more information.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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.

###  Release Activity

Cadence

Every ~169 days

Total

5

Last Release

1259d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/128b0c4f5bfbbb6c5c50211b542085dfa308f134243f001e3f726a8ed7f72338?d=identicon)[aurawindsurfing](/maintainers/aurawindsurfing)

---

Top Contributors

[![aurawindsurfing](https://avatars.githubusercontent.com/u/14302496?v=4)](https://github.com/aurawindsurfing "aurawindsurfing (11 commits)")

---

Tags

laravelSlashRemoveMiddleware

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/aurawindsurfing-slashremovemiddleware/health.svg)

```
[![Health](https://phpackages.com/badges/aurawindsurfing-slashremovemiddleware/health.svg)](https://phpackages.com/packages/aurawindsurfing-slashremovemiddleware)
```

###  Alternatives

[slowlyo/owl-admin

基于 laravel、amis 开发的后台框架~

61214.2k26](/packages/slowlyo-owl-admin)[erag/laravel-disposable-email

A Laravel package to detect and block disposable email addresses.

226102.4k](/packages/erag-laravel-disposable-email)[highsolutions/eloquent-sequence

A Laravel package for easy creation and management sequence support for Eloquent models with elastic configuration.

121130.3k](/packages/highsolutions-eloquent-sequence)[glhd/linen

21135.6k](/packages/glhd-linen)[api-platform/laravel

API Platform support for Laravel

59126.4k6](/packages/api-platform-laravel)[interaction-design-foundation/laravel-geoip

Support for multiple Geographical Location services.

17221.0k3](/packages/interaction-design-foundation-laravel-geoip)

PHPackages © 2026

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