Skip to content

Instantly share code, notes, and snippets.

@maxkostinevich
Last active April 15, 2020 19:06
Show Gist options
  • Save maxkostinevich/ab8f474c02767ccb114a7d052da80625 to your computer and use it in GitHub Desktop.
Save maxkostinevich/ab8f474c02767ccb114a7d052da80625 to your computer and use it in GitHub Desktop.
Laravel Force SSL
<?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