webpress / site-protection
Package for internal company
This package's canonical repository appears to be gone and the package has been frozen as a result. Email us for help if needed.
Requires
- illuminate/support: ^7.0|^8.0
Requires (Dev)
- orchestra/testbench: 5.0.0
- phpunit/phpunit: 8.5.13
- spatie/phpunit-watcher: 1.23.0
This package is auto-updated.
Last update: 2022-06-17 10:31:48 UTC
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