namewithin/auth-client
Composer 安装命令:
composer require namewithin/auth-client
包简介
Advanced auth for Laravel Passport
README 文档
README
Requirements
- laravel/framework: ~6.0
- laravel/passport: ^7.0
Installation
The library can be installed using Composer.
Add vcs repository url to the composer.json:
"repositories": [ { "type": "vcs", "url": "git@github.com:namewithin/auth-client.git" } ]
Install
composer require namewithin/auth-client
Usage
You can define guard with the client provider in the config/auth.php
'guards' => [ 'client-guard' => [ 'driver-guard' => 'client-driver', 'provider' => 'client', ], ],
Now you can protect your routes, only need to add the auth guard to auth middleware:
Route::get('profile', function () { // Only authenticated clients may enter... })->middleware('auth:client-guard'); Route::group([ 'middleware' => ['auth:api,client-guard'], // Only authenticated users and clients may enter... ], function () { Route::get('ticket/{id}/history', 'HistoryController@ticket'); });
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 5
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2019-03-13