solution-forest/filament-firewall
Composer 安装命令:
composer require solution-forest/filament-firewall
包简介
This is a middleware for whitelisting/blacklisting for Filament Admin
README 文档
README
Important
Please note that we will only be updating to version 4.x, excluding any bug fixes.
About Solution Forest
Solution Forest Web development agency based in Hong Kong. We help customers to solve their problems. We Love Open Sources.
We have built a collection of best-in-class products:
- InspireCMS: A full-featured Laravel CMS with everything you need out of the box. Build smarter, ship faster with our complete content management solution.
- Filaletter: Filaletter - Filament Newsletter Plugin
- Website CMS Management: A hands-on Filament CMS plugin for those who prefer more manual control over their website content management.
Filament Firewall
This package provides a whitelist and blacklist feature to restrict access to your Laravel application and Filament admin panel. For additional functionality, please refer to the Laravel Firewall package.
Supported Filament versions
| Filament Version | Plugin Version |
|---|---|
| v2 | 1.x.x |
| v3 | 2.x.x |
| v4 | 3.x.x |
| v5 | 4.x.x |
Getting Started
-
Install the package using the
composer requirecommand:composer require solution-forest/filament-firewall -
To publish the configuration files and migrations files for this plugin, as well as automatically run migration, enter the following command:
php artisan filament-firewall:install
-
This package comes with
WhitelistRangeMiddleware. You need to register it in$middleware:For Laravel version 11.x and above:
// in bootstrap/app.php ->withMiddleware(function (Middleware $middleware) { $middleware->append(\SolutionForest\FilamentFirewall\Middleware\WhitelistRangeMiddleware::class); })
For Laravel versions below 11.x:
// in app/Http/Kernel.php protected $middleware = [ ... \SolutionForest\FilamentFirewall\Middleware\WhitelistRangeMiddleware::class, ];
-
You can change the setting in the
config/filament-firewall.phpfile to skip the middlewareWhitelistRangeMiddlewarecheck. -
For additional configuration options, you can refer to the Laravel Firewall configuration file to customize more firewall settings. Some key configuration options include:
config('firewall.enabled')- Controls whether the firewall is enabled (default:true)config('firewall.middleware')- Middleware configuration settings
-
Register the plugin in your Panel provider:
Important: Register the plugin in your Panel provider after version 2.x
use SolutionForest\FilamentFirewall\FilamentFirewallPlugin; public function panel(Panel $panel): Panel { return $panel ->plugin(FilamentFirewallPlugin::make()); }
Usage
- On the IP Firewall page, you have the ability to add IPs to either a whitelist or a blocklist. The
WhitelistRangeMiddlewaremiddleware will automatically handle whitelist IP access. If you need to block a range of IPs while allowing a specific IP, such as blocking 172.19.0.0/24 except for 172.19.0.1, you'll need to create a new Deny access record and specify the IP and prefix as '172.19.0.0' and '24'. Additionally, you'll need to add an Allow access record for the specific IP '172.19.0.1'.
-
Get whitelist / blacklist records
// whitelist \SolutionForest\FilamentFirewall\Facade\FilamentFirewall::getWhiteList(); // blacklist \SolutionForest\FilamentFirewall\Facade\FilamentFirewall::getBlackList();
-
Determine whether an IP address is included in a whitelist or blacklist
// whitelist \SolutionForest\FilamentFirewall\Facade\FilamentFirewall::withinWhiteList($ip); // blacklist \SolutionForest\FilamentFirewall\Facade\FilamentFirewall::withinBlackList($ip);
Publishing translations
php artisan vendor:publish --tag=filament-firewall-translations
Security Vulnerabilities
If you discover any security related issues, please email info+package@solutionforest.net instead of using the issue tracker.
License
Please see License File for more information.
Credits
solution-forest/filament-firewall 适用场景与选型建议
solution-forest/filament-firewall 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 10.15k 次下载、GitHub Stars 达 44, 最近一次更新时间为 2023 年 05 月 17 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「Solution Forest」 「filament-firewall」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 solution-forest/filament-firewall 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 solution-forest/filament-firewall 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 solution-forest/filament-firewall 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
This is a tree layout plugin for Filament Admin
filament-access-management
This plugin provides a flexible tab layout system for Filament Admin panels, enabling you to organize content into clean, navigable tabbed interfaces.
This is a grid layout plugin for Filament Admin
Extract text from a pdf
paysafecard PHP REST API Library
统计信息
- 总下载量: 10.15k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 44
- 点击次数: 29
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-05-17