gnahotelsolutions/laravel-trailing-slash

End your Laravel project routes with trailing slash
3,469 11
Install
composer require gnahotelsolutions/laravel-trailing-slash
Latest Version:1.5.2
PHP:^8.2
License:MIT
Last Updated:Oct 15, 2025
Links: GitHub  ·  Packagist
Maintainer: lloople

Laravel trailing slash

Latest Version on Packagist Build status Quality Score Total Downloads

With this package you will be able to end your Laravel project routes with trailing slash.

Installation

You can install the package via composer:

composer require gnahotelsolutions/laravel-trailing-slash

Usage

Optionally, you can publish the config file of the package.

php artisan vendor:publish --provider="GNAHotelSolutions\LaravelTrailingSlash\LaravelTrailingSlashServiceProvider" --tag=config

If you want to disable the behaviour of this package, use this variable in your .env file.

TRAILING_SLASH=false

If you want to disable the behaviour of this package just in certain areas of your application, you can modify the configuration on runtime.

config()->set('laravel-trailing-slash.active', false);

If you are using Apache on your development or production environment, remember to remove or comment this lines in public/.htaccess

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email dtorralbo@gnahs.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

Laravel Package Boilerplate

This package was generated using the Laravel Package Boilerplate.

Related Packages

gnahotelsolutions/laravel-weather

🌤️ A wrapper around Open Weather Map to get the current weather on a location.

5,327 38
doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

637,827,751 9,703
laravel/framework

The Laravel Framework.

589,172,971 34,950
laravel/tinker

Powerful REPL for the Laravel framework.

498,216,183 7,442
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

413,412,504 609

Version History

Version Released PHP Laravel License
1.5.2 ^8.2 ^11.0|^12.0 MIT
1.5.1 ^8.2 ^11.0 MIT
1.5.0 ^8.2 ^11.0 MIT
1.4.0 ^7.2|^8.0 ^6.5|^7.0|^8.0|^9.0 MIT
1.3.0 ^7.2|^8.0 ^6.5|^7.0|^8.0 MIT