tequilarapido / restrict-access
1.0.4
2020-03-03 13:14 UTC
Requires
- laravel/framework: >=5.1 <=7
Requires (Dev)
- mockery/mockery: ^0.9.5
- orchestra/testbench: ^3.2
- phpunit/phpunit: 4.*
This package is auto-updated.
Last update: 2024-11-14 08:20:26 UTC
README
Installation
You can install the package using composer
$ composer require tequilarapido/restrict-access
Usage
- Add service provider
Tequilarapido\RestrictAccess\ServiceProvider::class,
- Add middlewares to kernel
protected $routeMiddleware = [
'restrict_access_by_ip' => RestrictAccessByIp::class,
'restrict_access_by_basic_auth' => RestrictAccessByBasicAuthentication::class,
];
-
Add middleware to routes on witch you need to restrict access
-
Env file
RESTRICT_ACCESS_BY_BASIC_AUTH_ENABLED=true
RESTRICT_ACCESS_BY_BASIC_AUTH_usename=username
RESTRICT_ACCESS_BY_BASIC_AUTH_password=password
RESTRICT_ACCESS_BY_IP_ENABLED=false
RESTRICT_ACCESS_BY_IP_ENABLED_EXCEPT=a,b,c
License
The MIT License (MIT). Please see License File for more information.