PHPackages                             willfd/auth0middlewarepackage - 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. willfd/auth0middlewarepackage

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

willfd/auth0middlewarepackage
=============================

Laravel Package for Using Auth0 Authentication in the middleware

1.0.2(1y ago)0304MITPHP

Since Mar 12Pushed 1y ago1 watchersCompare

[ Source](https://github.com/willfd/Auth0MiddleWarePackage)[ Packagist](https://packagist.org/packages/willfd/auth0middlewarepackage)[ RSS](/packages/willfd-auth0middlewarepackage/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (4)Versions (5)Used By (0)

Auth0MiddlewarePackage
======================

[](#auth0middlewarepackage)

Simple package to allow for auth0 middleware authentication based on scopes and buyerIds

Package Implementation
----------------------

[](#package-implementation)

### Add Package to app

[](#add-package-to-app)

#### Add package to composer.json

[](#add-package-to-composerjson)

Add package requirement

```
"require-dev": {
  "willfd/auth0middlewarepackage": "^1.0.0"
},
```

### App Config

[](#app-config)

#### create config file for package

[](#create-config-file-for-package)

```
php artisan vendor:publish
```

#### set env variables

[](#set-env-variables)

```
AUTH0_DOMAIN=          STRING                   ie https://domain-staging.uk.auth0.com
AUTH0_CLIENT_ID=       STRING                   ie ABcD1eFgHiJkL23Mn4opQ5rSTuVwXyzA
AUTH0_AUDIENCE=        STRING                   ie tmf-api
AUTH0_REQUIRED_SCOPES= STRING COMMA SEPERATED   ie write:app-example,read:app-example
AUTH0_ADMIN_SCOPES=    STRING COMMA SEPERATED   ie admin:app-example

```

### Add Provider

[](#add-provider)

In boostrap/providers.php, add the packages provider class

```
use willfd\auth0middlewarepackage\MiddlewarePackageServiceProvider;
...
return [
    MiddlewarePackageServiceProvider::class
];
```

#### Set Middleware Alias (optional)

[](#set-middleware-alias-optional)

In bootstrap/app.php add below. The alias can be called anything, the alias shall be used to reference the middleware within the routes

```
$middleware->alias([
    'package' => Auth0AuthenticateMiddleware::class,
]);
```

#### route setup

[](#route-setup)

Add middleware to desired routes. "package" is the middlewares alias, "write:example-scope" is the required scope any routes within the middleware route.

```
Route::middleware('package:write:example-scope')
```

Details
-------

[](#details)

If admin scopes are provided within the env. required scopes can be ignored if an admin scope is provided in the env with a matching name ie if the required scope is read:example-app then admin:example-app would bypass the required scope.

Local Dev
---------

[](#local-dev)

### Docker

[](#docker)

Spin up container using below (first time also include --build)

```
docker-compose up
```

### tests

[](#tests)

```
vendor/bin/phpunit tests/
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance46

Moderate activity, may be stable

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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 ~6 days

Total

3

Last Release

420d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1878a48d8fa0e74252c3e72d4b50556b6dbef3e7463ef235f96a5c2e5cb092b2?d=identicon)[willfd](/maintainers/willfd)

---

Top Contributors

[![willfd](https://avatars.githubusercontent.com/u/73963680?v=4)](https://github.com/willfd "willfd (40 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/willfd-auth0middlewarepackage/health.svg)

```
[![Health](https://phpackages.com/badges/willfd-auth0middlewarepackage/health.svg)](https://phpackages.com/packages/willfd-auth0middlewarepackage)
```

###  Alternatives

[lab404/laravel-impersonate

Laravel Impersonate is a plugin that allows to you to authenticate as your users.

2.3k16.4M48](/packages/lab404-laravel-impersonate)[santigarcor/laratrust

This package provides a flexible way to add Role-based Permissions to Laravel

2.3k5.4M43](/packages/santigarcor-laratrust)[overtrue/laravel-follow

User follow unfollow system for Laravel.

1.2k404.7k5](/packages/overtrue-laravel-follow)[auth0/symfony

Symfony SDK for Auth0 Authentication and Management APIs.

128738.1k](/packages/auth0-symfony)

PHPackages © 2026

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