https://github.com/backstagephp/laravel-trailing-slash
Use Laravel explicitly with or without trailing slashes, controlling URL generation and proper redirects for SEO.
https://github.com/backstagephp/laravel-trailing-slash
Last synced: 3 months ago
JSON representation
Use Laravel explicitly with or without trailing slashes, controlling URL generation and proper redirects for SEO.
- Host: GitHub
- URL: https://github.com/backstagephp/laravel-trailing-slash
- Owner: backstagephp
- License: mit
- Created: 2024-04-20T11:37:07.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-02-26T13:50:41.000Z (11 months ago)
- Last Synced: 2025-02-26T14:35:18.543Z (11 months ago)
- Language: PHP
- Homepage:
- Size: 50.8 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
Awesome Lists containing this project
README
# Laravel Trailing Slash by Backstage
[](https://packagist.org/packages/backstage/laravel-trailing-slash)
[](https://github.com/backstagephp/laravel-trailing-slash/actions?query=workflow%3Arun-tests+branch%3Amain)
[](https://github.com/backstagephp/laravel-trailing-slash/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain)
[](https://packagist.org/packages/backstage/laravel-trailing-slash)
Use Laravel explicitly with or without trailing slashes, controlling URL generation and proper redirects for SEO. Works out of the box on installation, without modifications to your application code.
## Installation
You can install the package via composer:
```bash
composer require backstage/laravel-trailing-slash
```
You can publish the config file with:
```bash
php artisan vendor:publish --tag="laravel-trailing-slash-config"
```
This is the contents of the published config file:
```php
return [
// Enable or disable trailing slashes
'trailing' => env('TRAILING_SLASHES', true),
// Enable or disable automatic setup of this package
// When enabled, only installing this package is sufficient for everything to work
'auto' => env('TRAILING_SLASHES_AUTO', true),
// Execute middleware only on these methods
'methods' => [
'GET', 'HEAD', 'OPTIONS',
],
];
```
## Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
## Contributing
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
## Security Vulnerabilities
Please review [our security policy](../../security/policy) on how to report security vulnerabilities.
## Credits
- [Mark van Eijk](https://github.com/markvaneijk)
- [All Contributors](../../contributors)
## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.