webparking/laravel-limited-access
Composer 安装命令:
composer require webparking/laravel-limited-access
包简介
Limited access for Laravel
README 文档
README
Laravel limited access
This package provides an easy access-restricting layer for your Laravel application.
With limited access you can block or allow certain ip addresses on application level. You could also define a list of access codes to distribute between trusted users.
A few use-cases are:
- Set access codes for an application that is not ready to go live yet. For example an acceptance environment.
- Block malicious users from using your application. Simply add their ip addresses to the blocked list.
- Making a private application only a few users can access. Just block all ip addresses except your own.
Here's an example of what your login could look like when using access codes
Installation
Add this package to composer.
composer require webparking/laravel-limited-access
Publish assets:
php artisan vendor:publish --provider="Webparking\LimitedAccess\ServiceProvider" --tag="public"
Optional steps
Publish config:
php artisan vendor:publish --provider="Webparking\LimitedAccess\ServiceProvider" --tag="config"
Publish translations:
php artisan vendor:publish --provider="Webparking\LimitedAccess\ServiceProvider" --tag="lang"
Or just publish all the things:
php artisan vendor:publish --provider="Webparking\LimitedAccess\ServiceProvider"
Usage
To use this package you need to enable it by either enabling the package in the config or adding the following to your .env file.
LIMITED_ACCESS_ENABLED=true
To add access codes add the following key to your .env file and specify your access codes in a comma separated list.
LIMITED_ACCESS_CODES=comma,separated,access,codes
Blocking/Ignoring IP addresses
In config/limited-access you can add single IP addresses or IP address ranges in CIDR format.
Example:
return [ 'block_ips' => [ '192.168.1.0/24', '66.66.66.66', // 66.66.66.66/32 is equivalent '2000:ffff::1', '2000:ffff/64', ], 'ignore_ips' => [ '11.22.33.44', '10.0.0.0/8', '127.0.0.1', '::1', ], ];
Blocked IPs take priority over ignored IPs, so adding the same address or range to both arrays will cause the given IP to be blocked.
You can leave both of these arrays empty if you wish for everyone to be prompted for a password.
Licence and Postcardware
This software is open source and licensed under the MIT license.
If you use this software in your daily development we would appreciate to receive a postcard of your hometown.
Please send it to: Webparking BV, Cypresbaan 31a, 2908 LT Capelle aan den IJssel, The Netherlands
webparking/laravel-limited-access 适用场景与选型建议
webparking/laravel-limited-access 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.08k 次下载、GitHub Stars 达 33, 最近一次更新时间为 2020 年 09 月 08 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 webparking/laravel-limited-access 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 webparking/laravel-limited-access 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 1.08k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 33
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-09-08
