PHPackages                             grixu/passport-module-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. grixu/passport-module-auth

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

grixu/passport-module-auth
==========================

This package provides model, command &amp; middleware to easily forbid access to certain modules(domains in DDD) when using Client Credentials Grant Tokens

1.2.2(4y ago)0523[5 PRs](https://github.com/grixu/passport-module-auth/pulls)MITPHPPHP ^7.1|^8.0

Since Nov 30Pushed 3y ago1 watchersCompare

[ Source](https://github.com/grixu/passport-module-auth)[ Packagist](https://packagist.org/packages/grixu/passport-module-auth)[ Docs](https://github.com/grixu/passport-module-auth)[ RSS](/packages/grixu-passport-module-auth/feed)WikiDiscussions main Synced today

READMEChangelog (7)Dependencies (12)Versions (13)Used By (0)

Passport Module Auth
====================

[](#passport-module-auth)

This package provides model, commands &amp; middleware to easily forbid access to certain modules(domains in DDD) when using Client Credentials Grant Tokens.

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

[](#installation)

You can install the package via composer:

```
composer require grixu/passport-module-auth
```

Usage
-----

[](#usage)

Publish config file to adjust module names in your project:

```
php artisan vendor:publish --tag=config --provider=Grixu\\PassportModuleAuth\\PassportModuleAuthServiceProvider
```

Add the middleware to your Kernel class which handling HTTP requests in your Laravel project. In default project scaffold you should edit: `app/Http/Kernel.php`

```
use Grixu\PassportModuleAuth\Middleware\ModuleAuthMiddleware;

/**
 * The application's route middleware.
 *
 * These middleware may be assigned to groups or used individually.
 *
 * @var array
 */
protected $routeMiddleware = [
    'auth' => Authenticate::class,
    'auth.basic' => AuthenticateWithBasicAuth::class,
    'client' => CheckClientCredentials::class,
    'cache.headers' => SetCacheHeaders::class,
    'can' => Authorize::class,
    'guest' => RedirectIfAuthenticated::class,
    'password.confirm' => RequirePassword::class,
    'signed' => ValidateSignature::class,
    'throttle' => ThrottleRequests::class,
    'verified' => EnsureEmailIsVerified::class,
    'passport_module' => ModuleAuthMiddleware::class
];
```

Then just use it in your controllers or routes. Remember about passing module name!

```
Route::middleware(['passport_module:products']);
```

### Artisan command

[](#artisan-command)

You can use artisan command `passport:module-auth` to manage entries in Module Auth system.

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [grixu](https://github.com/grixu)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 93.2% 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 ~59 days

Recently: every ~4 days

Total

7

Last Release

1635d ago

PHP version history (2 changes)1.0.0PHP ^7.1

1.0.1PHP ^7.1|^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/67002661?v=4)[Mateusz Gostański](/maintainers/grixu)[@grixu](https://github.com/grixu)

---

Top Contributors

[![grixu](https://avatars.githubusercontent.com/u/67002661?v=4)](https://github.com/grixu "grixu (41 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (3 commits)")

---

Tags

hacktoberfestgrixupassport-module-auth

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/grixu-passport-module-auth/health.svg)

```
[![Health](https://phpackages.com/badges/grixu-passport-module-auth/health.svg)](https://phpackages.com/packages/grixu-passport-module-auth)
```

###  Alternatives

[laragear/two-factor

On-premises 2FA Authentication for out-of-the-box.

339785.3k8](/packages/laragear-two-factor)[casbin/laravel-authz

An authorization library that supports access control models like ACL, RBAC, ABAC in Laravel.

324339.9k4](/packages/casbin-laravel-authz)[fumeapp/modeltyper

Generate TypeScript interfaces from Laravel Models

196277.9k](/packages/fumeapp-modeltyper)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)[scaler-tech/laravel-saml2

SAML2 Service Provider integration for Laravel applications, based on OneLogin toolkit

2737.5k](/packages/scaler-tech-laravel-saml2)[alajusticia/laravel-logins

Session management in Laravel apps, user notifications on new access, support for multiple separate remember tokens, IP geolocation, User-Agent parser

2011.0k](/packages/alajusticia-laravel-logins)

PHPackages © 2026

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