alitindrawan24/laravel-ip-whitelist 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

alitindrawan24/laravel-ip-whitelist

最新稳定版本:0.1.2

Composer 安装命令:

composer require alitindrawan24/laravel-ip-whitelist

包简介

README 文档

README

Latest Version on Packagist Total Downloads License: MIT

Laravel IP Whitelist is a package contain middleware to allow a list of IP addresses to access a specific web resource.

Installation

You can install the package via composer:

composer require alitindrawan24/laravel-ip-whitelist

You can publish the config file with:

php artisan vendor:publish --provider="Alitindrawan24\IPWhitelist\IPWhitelistServiceProvider" --tag="config" 

By default the IP Whitelist feature is disabled, to enable the feature you add this in your .env

IP_WHITELIST_ENABLE=true

You can add the list of IP that allowed in config/ip-whitelist.php using fix IP or using wildcard

/**
 * List of IP Whitelist.
 * Only IP in this list is allowed to pass the middleware.
 */
'ip_whitelist' => [
    // '127.0.0.1' // Localhost example
    // '127.0.0.*' // Using Wildcard example
],

Usage

This packages provides a middleware which can be added as a global middleware or as a single route.

// in `app/Http/Kernel.php`

protected $middleware = [
    // ...
    
    \Alitindrawan24\IPWhitelist\Middleware\HttpLogger::class
];
// in a routes file

Route::post('/dashboard', function () {
    //
})->middleware(\Alitindrawan24\IPWhitelist\Middleware\HttpLogger::class);

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Contributors

统计信息

  • 总下载量: 250
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-05-06