PHPackages                             ancoka/larav-oauth2-client - 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. ancoka/larav-oauth2-client

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

ancoka/larav-oauth2-client
==========================

This is an simple OAuth client service.

1.0.3(7y ago)370MITPHPPHP &gt;=5.6

Since Jun 19Pushed 7y ago1 watchersCompare

[ Source](https://github.com/ancoka/larav-oauth2-client)[ Packagist](https://packagist.org/packages/ancoka/larav-oauth2-client)[ RSS](/packages/ancoka-larav-oauth2-client/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (1)Versions (6)Used By (0)

larav-oauth2-client
===================

[](#larav-oauth2-client)

larav oauth2 client 是一个针对 Laravel framework 实现的一个简单的 进行 OAuth 认证的扩展包。

安装
--

[](#安装)

1. 环境要求 `PHP >= 5.6 ` 并且 `laravel >= 5.4`
2. 安装 larav oauth2 client，只需要添加下面内容到你的 composer.json 文件。然后执行 `composer update`：

    ```
    "ancoka/larav-oauth2-client": "1.0.*"

    ```

    或者直接执行：

    ```
    composer require "ancoka/larav-oauth2-client:1.0.*"

    ```
3. 打开 `config/app.php` 文件添加下面内容到 `providers` 数组：

    ```
    Ancoka\OAuth\OAuthServiceProvider::class,

    ```
4. 同样在 `config/app.php` 文件中添加下面内容到 `aliases` 数组：

    ```
    'OAuth' => Ancoka\OAuth\Facades\OAuth::class,

    ```
5. 运行如下命令发布扩展包内配置文件 `config/oauth_client.php`

    ```
    php artisan vendor:publish --provider="Ancoka\OAuth\OAuthServiceProvider"

    ```

使用
--

[](#使用)

#### 路由

[](#路由)

生成 OAuth 认证路由，执行以下内容：

```
php artisan make:oauth

```

会在 `routes/web.php` 文件中添加 `OAuth::routes()` 。

#### 中间件

[](#中间件)

你可以使用中间件拦截需要进行身份验证的所有路由，类似以下内容：

```
Route::middleware(['oauth.authorize'])->group(function () {
    Route::get('/', 'IndexController@index')->name('home');
});

```

License
-------

[](#license)

MIT

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~10 days

Total

4

Last Release

2853d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/caba98e078c31bb7ca5e71353984e5a6e26978616050c086cd138fd06366dfb7?d=identicon)[lov3smu](/maintainers/lov3smu)

---

Top Contributors

[![lov3smu](https://avatars.githubusercontent.com/u/9568665?v=4)](https://github.com/lov3smu "lov3smu (11 commits)")

---

Tags

laravellaravel-packageoauth2oauth2-clientlaraveloauthlaravel-oauth

### Embed Badge

![Health badge](/badges/ancoka-larav-oauth2-client/health.svg)

```
[![Health](https://phpackages.com/badges/ancoka-larav-oauth2-client/health.svg)](https://phpackages.com/packages/ancoka-larav-oauth2-client)
```

###  Alternatives

[ellaisys/aws-cognito

AWS Cognito package that allows Auth and other related features using the AWS SDK for PHP

120220.7k1](/packages/ellaisys-aws-cognito)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
