Skip to content

Latest commit

 

History

History
19 lines (18 loc) · 414 Bytes

force-https.md

File metadata and controls

19 lines (18 loc) · 414 Bytes

Force HTTPS

If you want to force HTTPS in your project, do it in AppServiceProvider file's boot() method

class AppServiceProvider extends ServiceProvider
{
    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        if (env('APP_ENV') === 'production') {
            $this->app['url']->forceScheme('https');
        }
    }
}