smorken/ip-auth
最新稳定版本:v10.5.0
Composer 安装命令:
composer require smorken/ip-auth
包简介
IP Authorization - not truly secure!
README 文档
README
Laravel IP Authorization
Contains some helpers for the basic IP Authorization. Note that IP addresses can be spoofed to some extent (mainly incorrect use of a proxy).
Service provider should be auto loaded but if not:
Add
\Smorken\IpAuth\ServiceProvider::classto theconfig/app.phpservice providersIf needed, publish the config and view files
php artisan vendor:publish --provider="Smorken\IpAuth\ServiceProvider" --tag=viewsphp artisan vendor:publish --provider="Smorken\IpAuth\ServiceProvider" --tag=config
Add the middleware to your
App\Http\Kernel.php
/**
* The application's route middleware.
*
* @var array
*/
protected $routeMiddleware = [
...
'ip-active' => \Smorken\IpAuth\Http\Middleware\IpActive::class,
'user-active' => \Smorken\IpAuth\Http\Middleware\UserActive::class,
...
];
- Add the middleware key to your routes that need it
Route:middleware(['ip-active', 'user-active'])
->group(function () {
Route::get('/', 'HomeController@index');
Route::get('/customers', 'HomeController@customers');
Route::post('/cart/{customer_id}', 'CartController@doCart');
});
- Add to
config/menus.php
...
'role-manage' => [
[
'name' => 'Authorize',
'action' => [\Smorken\IpAuth\Http\Controllers\AuthorizeController::class, 'index'],
'children' => [],
],
...
统计信息
- 总下载量: 421
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-12-03