PHPackages                             mbvanderleest/cfx-laravel-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. mbvanderleest/cfx-laravel-auth

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

mbvanderleest/cfx-laravel-auth
==============================

CFX.re OAuth provider for Laravel Socialite

014PHP

Since Dec 29Pushed 4mo agoCompare

[ Source](https://github.com/mbvanderleest/laravel-12-cfx-login)[ Packagist](https://packagist.org/packages/mbvanderleest/cfx-laravel-auth)[ RSS](/packages/mbvanderleest-cfx-laravel-auth/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)DependenciesVersions (1)Used By (0)

CFX.re Laravel Auth
===================

[](#cfxre-laravel-auth)

A simple Laravel 12 package for logging in with [CFX.re](https://forum.cfx.re/) (FiveM/RedM) using [Socialite](https://laravel.com/docs/12.x/socialite).

Requirements
------------

[](#requirements)

- PHP 8.2+
- Laravel 12.x
- Laravel Socialite 5.5+

Installation
------------

[](#installation)

```
composer require mbvanderleest/cfx-laravel-auth
php artisan cfx:generate-keys
```

Add this to your `.env`:

```
CFX_APP_NAME="My App"
CFX_CLIENT_ID=your_client_id
CFX_REDIRECT_URL=http://your-domain.com/auth/cfx/callback
CFX_AVATAR_SIZE=128
```

Basic Setup
-----------

[](#basic-setup)

Add these routes in `routes/web.php`:

```
use Laravel\Socialite\Facades\Socialite;

Route::get('/auth/cfx', fn() => Socialite::driver('cfx')->redirect());

Route::get('/auth/cfx/callback', function () {
    $user = Socialite::driver('cfx')->user();
    return $user; // $user->getId(), $user->getNickname(), etc.
});
```

Optional Controller
-------------------

[](#optional-controller)

```
class AuthController extends Controller
{
    public function redirectToCfx()
    {
        return Socialite::driver('cfx')->redirect();
    }

    public function handleCfxCallback()
    {
        $cfx = Socialite::driver('cfx')->user();

        $user = User::firstOrCreate(['cfx_id' => $cfx->getId()], [
            'name' => $cfx->getNickname(),
            'email' => $cfx->getEmail(),
            'avatar' => $cfx->getAvatar(),
        ]);

        auth()->login($user);
        return redirect('/dashboard');
    }
}
```

Notes
-----

[](#notes)

- Keep your private key safe
- HTTPS is required in production
- Email may not always be available

License
-------

[](#license)

MIT License

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance51

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity12

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/325c9f431220a92d59d7d7022f17437133dd881ac3c5d77b2154741b4d3cc176?d=identicon)[mbvanderleest](/maintainers/mbvanderleest)

---

Top Contributors

[![mbvanderleest](https://avatars.githubusercontent.com/u/64595795?v=4)](https://github.com/mbvanderleest "mbvanderleest (3 commits)")

### Embed Badge

![Health badge](/badges/mbvanderleest-cfx-laravel-auth/health.svg)

```
[![Health](https://phpackages.com/badges/mbvanderleest-cfx-laravel-auth/health.svg)](https://phpackages.com/packages/mbvanderleest-cfx-laravel-auth)
```

###  Alternatives

[namshi/jose

JSON Object Signing and Encryption library for PHP.

1.8k99.6M101](/packages/namshi-jose)[league/oauth1-client

OAuth 1.0 Client Library

99698.8M106](/packages/league-oauth1-client)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[league/oauth2-google

Google OAuth 2.0 Client Provider for The PHP League OAuth2-Client

41721.2M118](/packages/league-oauth2-google)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)

PHPackages © 2026

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