webazin / country-middleware
路由访问中的国家封禁和国家所需验证码
v1.0
2022-04-18 11:46 UTC
Requires
- torann/geoip: ^3.0
README
安装
1-composer require webazin/country-middleware
2-在laravel < 5中插入
config/app.php
\Webazin\CountryMiddleware\CountryMiddlewareServiceProvider::class
3-php artisan vendor:publish
4-Webazin\CountryMiddleware\CountryMiddlewareServiceProvider
使用
在路由中添加
->middleware('countryCheck')
封禁国家
config/CountryMiddleware.php
添加国家iso_code
例如
countries_ban' => ['US']
所有iso代码见以下链接
[https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes ](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes)
webazin.net