Package Data | |
---|---|
Maintainer Username: | OwenMelbz |
Maintainer Contact: | owenmelbz@gmail.com (Owen Melbourne) |
Package Create Date: | 2017-05-26 |
Package Last Update: | 2020-03-22 |
Home Page: | |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-12-23 03:00:29 |
Package Statistics | |
---|---|
Total Downloads: | 4,842 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 23 |
Total Watchers: | 2 |
Total Forks: | 5 |
Total Open Issues: | 0 |
An automatic piece of middleware for Laravel 5.x, which will force users to access your application via what is defined in the APP_URL - especially useful for SEO forcing non-www users to www etc, unless specified in the ignore list
Install via composer composer require owenmelbz/domain-enforcement
Register the service provider - typically done inside the app.php
providers array e.g OwenMelbz\DomainEnforcement\DomainEnforcementServiceProvider::class
Add ENFORCE_DOMAIN=true
to your application environment config e.g .env
Enjoy your stress free architecture agnostic redirects
If you publish the config via php artisan vendor:publish --provider="OwenMelbz\DomainEnforcement\DomainEnforcementServiceProvider"
you can exclude urls from getting enforced.
Too often we've wasted time configuring redirections, with proxy systems like CloudFlare, with apache development machines and nginx production, this removes all the headache and can simply be turned off and on at a whim.