Force https schema if APP_FORCE_SSL=true in .env

This commit is contained in:
zjean 2016-05-04 22:09:42 +02:00
parent 3344bb7263
commit cb1cb9f328
3 changed files with 6 additions and 1 deletions

View File

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

View File

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

View File

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