morningtrain/laravel-https

Provides some initial https setup

1.6.0 2023-05-08 05:08 UTC

This package is auto-updated.

Last update: 2024-04-08 07:05:47 UTC


README

Install

Via Composer

$ composer require morningtrain/laravel-https

Usage

Deploy the config files.

$ php artisan vendor:publish

Update the following in your .env:

USE_SSL=true
REDIRECT_TO_HTTPS=true

Register the ForceSSL middleware as a global middleware in your App\Httk\Kernel class:

class Kernel extends HttpKernel
{
    /**
     * The application's middleware stack.
     *
     * @var array
     */
    protected $middleware = [
        \MorningTrain\Laravel\Https\Http\Middleware\ForceSSL::class,
    ];
}

Credits