Last active
April 15, 2020 19:06
-
-
Save maxkostinevich/ab8f474c02767ccb114a7d052da80625 to your computer and use it in GitHub Desktop.
Laravel Force SSL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Just add the following code to boot() method: | |
// \URL::forceSchema('https'); // for Laravel 5.3 | |
// \URL::forceScheme('https'); // for Laravel 5.4 | |
// ... | |
class AppServiceProvider extends ServiceProvider | |
{ | |
/** | |
* Bootstrap any application services. | |
* | |
* @return void | |
*/ | |
public function boot() | |
{ | |
// | |
// Force SSL | |
// \URL::forceSchema('https'); // for Laravel 5.3 | |
\URL::forceScheme('https'); // for Laravel 5.4 | |
} | |
// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment