PHPackages                             fx/hyperf-http-auth - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. fx/hyperf-http-auth

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

fx/hyperf-http-auth
===================

use auth in hyperf as in laravel

v3.0.0(5y ago)2524412MITPHPPHP &gt;=7.3

Since Dec 26Pushed 5y ago2 watchersCompare

[ Source](https://github.com/nfangxu/hyperf-http-auth)[ Packagist](https://packagist.org/packages/fx/hyperf-http-auth)[ RSS](/packages/fx-hyperf-http-auth/feed)WikiDiscussions master Synced 5d ago

READMEChangelog (4)Dependencies (9)Versions (12)Used By (2)

Hyperf 下 http 认证组件
==================

[](#hyperf-下-http-认证组件)

- 仿照 laravel auth 组件, 抽离出其中的核心逻辑, 形成当前扩展包
- 将 UserProvider 与 Guard 抽离出去, 形成单独扩展包, 方便扩展, 默认使用以下组合

    - [fx/eloquent-provider](https://github.com/nfangxu/hyperf-auth-eloquent-provider) 使用 Eloquent ORM ;
    - [fx/session-guard](https://github.com/nfangxu/hyperf-auth-session-guard) 使用 session 作为 guard ;
- 2.0 版本开始, 需手动安装 [`fx/eloquent-provider`](https://github.com/nfangxu/hyperf-auth-eloquent-provider) 和 [`fx/session-guard`](https://github.com/nfangxu/hyperf-auth-session-guard)

使用
--

[](#使用)

### 安装

[](#安装)

```
composer require fx/hyperf-http-auth:"^1.1"
```

### 发布配置文件

[](#发布配置文件)

```
php bin/hyperf.php vendor:publish fx/hyperf-http-auth
```

### 创建用户 model 并修改为以下配置

[](#创建用户-model-并修改为以下配置)

```
