Merge pull request #260 from zjean/ssl

Force https schema if APP_FORCE_SSL=true in .env
This commit is contained in:
James Cole 2016-05-12 11:00:41 +02:00
commit ebb1c5ae25
3 changed files with 6 additions and 1 deletions

View File

@ -1,5 +1,6 @@
APP_ENV=production APP_ENV=production
APP_DEBUG=false APP_DEBUG=false
APP_FORCE_SSL=true
APP_KEY=SomeRandomStringOf32CharsExactly APP_KEY=SomeRandomStringOf32CharsExactly
LOG_LEVEL=warning LOG_LEVEL=warning

View File

@ -1,5 +1,6 @@
APP_ENV=testing APP_ENV=testing
APP_DEBUG=true APP_DEBUG=true
APP_FORCE_SSL=false
APP_KEY=SomeRandomStringOf32CharsExactly APP_KEY=SomeRandomStringOf32CharsExactly
LOG_LEVEL=debug LOG_LEVEL=debug

View File

@ -20,7 +20,10 @@ class AppServiceProvider extends ServiceProvider
*/ */
public function boot() public function boot()
{ {
// // force https urls
if (env('APP_FORCE_SSL', false)) {
\URL::forceSchema('https');
}
} }
/** /**