PHPackages                             etsvthor/laravel-bifrost-bridge - 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. etsvthor/laravel-bifrost-bridge

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

etsvthor/laravel-bifrost-bridge
===============================

Connect a laravel application with the Bifrost oauth2 server

1.5.0(4mo ago)13.5k↑173.3%[1 PRs](https://github.com/etsvThor/laravel-bifrost-bridge/pulls)MITPHPPHP ~8.3.0 | ~8.4.0 | ~8.5.0CI passing

Since Dec 19Pushed 1w ago2 watchersCompare

[ Source](https://github.com/etsvThor/laravel-bifrost-bridge)[ Packagist](https://packagist.org/packages/etsvthor/laravel-bifrost-bridge)[ Docs](https://github.com/etsvthor/laravel-bifrost-bridge)[ RSS](/packages/etsvthor-laravel-bifrost-bridge/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (10)Dependencies (14)Versions (40)Used By (0)

laravel-bifrost-bridge
======================

[](#laravel-bifrost-bridge)

[![Latest Version on Packagist](https://camo.githubusercontent.com/3bec6bdae9e00dad80d29c6ed6cc48f685f8d92d81b845e17ee3c920a1410d16/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6574737674686f722f6c61726176656c2d626966726f73742d6272696467652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/etsvthor/laravel-bifrost-bridge)

Connect a laravel application with the Bifrost

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

[](#installation)

First, install [spatie/laravel-permission](https://github.com/spatie/laravel-permission), follow their installation guide

You can then install the package via composer:

```
composer require etsvthor/laravel-bifrost-bridge
```

You can publish the config file of bifrost and the underlying spatie permissions config+migrations with:

```
php artisan vendor:publish --provider="EtsvThor\\BifrostBridge\\BifrostBridgeServiceProvider" --tag="bifrost-config"
```

- Ensure the `users` has a `oauth_user_id` and `email_verified_at` column.
- In the `User` model, cast `email_verified_at` to `datetime` and add the `HasRoles` trait.
- (only laravel &lt;11) Please add `'webhooks/bifrost'` to the CSRF exceptions in `App\Http\Middleware\VerifyCsrfToken` class

Environment
-----------

[](#environment)

Add the following to your `.env` file and fill them in:

```
# Required configuration
BIFROST_ENABLED=true
BIFROST_CLIENT_ID=
BIFROST_CLIENT_SECRET=
BIFROST_AUTH_PUSH_KEY=

# Optional configuration with its defaults
BIFROST_REDIRECT_URL="/login/callback"
BIFROST_HOST="https://bifrost.thor.edu"
BIFROST_ROUTE_PREFIX=
```

Configuration
-------------

[](#configuration)

In the configuration file, one can specify some thing about the user model, but have some sensible defaults

See [config/bifrost.php](config/bifrost.php) for all options.

Make sure to seed all required roles, otherwise they will not sync

### Resolvers

[](#resolvers)

The `User` and `Role` model can be resolved using a custom resolver

```
use Spatie\Permission\Models\Role;
use Illuminate\Database\Eloquent\Model as EloquentModel;

// Default behaviour
BifrostBridge::resolveUserClassUsing(function(/* auto injection works here */): EloquentModel {
    return app(config('bifrost.user.model', 'App\\Models\\User'));
});

// Default behaviour
BifrostBridge::resolveRoleClassUsing(function(/* auto injection works here */): Role {
    return app(PermissionRegistrar::class)->getRoleClass();
});

// Disabled role sync
BifrostBridge::resolveRoleClassUsing(fn() => null);

// Override the way a user is resolved
BifrostBridge::resolveAndUpdateUserUsing(function(/* auto injection works here */, BifrostUserData $data): ?EloquentModel {
    // Model should implement \Illuminate\Contracts\Auth\Authenticatable

    return null; // when null is returned, the user is not logged in
})
```

### CSRF (laravel &lt;11 only)

[](#csrf-laravel-11-only)

Don't forget to add `'webhooks/bifrost'` to the `$except` array in `App\Http\Middleware\VerifyCsrfToken.php`.

###  Health Score

56

—

FairBetter than 97% of packages

Maintenance89

Actively maintained with recent releases

Popularity21

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity83

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 54.4% 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 ~70 days

Recently: every ~85 days

Total

28

Last Release

124d ago

Major Versions

0.6.3 → 1.0.12024-04-18

PHP version history (8 changes)0.1.0PHP ^7.4 | ~8.0.0

0.5.3PHP ^7.4 | ^8.0

0.5.4PHP ^7.4 | ~8.0.0 | ~8.1.0

0.6.0PHP ~8.0.0 | ~8.1.0

0.6.2PHP ~8.0.0 | ~8.1.0 | ~8.2.0

0.6.3PHP ~8.1.0 | ~8.2.0 | ~8.3.0

1.4.0PHP ~8.1.0 | ~8.2.0 | ~8.3.0 | ~8.4.0

1.5.0PHP ~8.3.0 | ~8.4.0 | ~8.5.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/100052?v=4)[Tom Janssen](/maintainers/dododedodonl)[@dododedodonl](https://github.com/dododedodonl)

![](https://www.gravatar.com/avatar/80a2e10c9af40dd1716f9d50700c1a884581c3fd8ba0ebc5591f2e21874b37da?d=identicon)[niekBr](/maintainers/niekBr)

---

Top Contributors

[![niekbr](https://avatars.githubusercontent.com/u/10487997?v=4)](https://github.com/niekbr "niekbr (81 commits)")[![dododedodonl](https://avatars.githubusercontent.com/u/100052?v=4)](https://github.com/dododedodonl "dododedodonl (48 commits)")[![ThijsLacquet](https://avatars.githubusercontent.com/u/28624985?v=4)](https://github.com/ThijsLacquet "ThijsLacquet (9 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (7 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (4 commits)")

###  Code Quality

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/etsvthor-laravel-bifrost-bridge/health.svg)

```
[![Health](https://phpackages.com/badges/etsvthor-laravel-bifrost-bridge/health.svg)](https://phpackages.com/packages/etsvthor-laravel-bifrost-bridge)
```

###  Alternatives

[nasirkhan/laravel-starter

A CMS like modular Laravel starter project.

1.4k2.7k](/packages/nasirkhan-laravel-starter)[unopim/unopim

UnoPim Laravel PIM

10.5k2.4k](/packages/unopim-unopim)[typicms/base

A modular multilingual CMS built with Laravel, enabling developers to manage structured content like pages, news, events, and more.

1.6k20.4k](/packages/typicms-base)

PHPackages © 2026

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