With this package you will be able to end your Laravel project routes with trailing slash.
You can install the package via composer:
composer require gnahotelsolutions/laravel-trailing-slash
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]
composer test
Please see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email dtorralbo@gnahs.com instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.
This package was generated using the Laravel Package Boilerplate.