webpress/site-protection

There is no license information available for the latest version (3.1.87) of this package.

Package for internal company


README

Installation

To include the package in your project, Please run following command.

composer require webpress/site-protection

Service Provider

In your config/app.php add the following Service Providers to the end of the providers array:

'providers' => [
    ...
    VCComponent\Laravel\Site\Providers\SiteProtectionServiceProvider::class,
],

Config

Run the following commands to publish config/site-protection.php and resources/sass/protection/_protection.scss files.

php artisan vendor:publish 

You can change default account and password in config/site-protection.php.

'custom_or_default' => [

    'account'  => env('ACCOUNT_SITE_PROTECTION', "default account"),

    'password' => env('PASSWORD_SITE_PROTECTION', "default_password"),

],

Kernel

If you want to display error messages when users enter invalid account, you need to edit in kernel.php file.

protected $middleware = [
    ...
    \Illuminate\Session\Middleware\StartSession::class,
];

Environment

In .env file, we need some configuration. We can enter account and password in the variables ACCOUNT_SITE_PROTECTION and PASSWORD_SITE_PROTECTION.

SITE_PROTECTION=true

ACCOUNT_SITE_PROTECTION=your_account

PASSWORD_SITE_PROTECTION=your_password