PHPackages                             mostbyte/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. mostbyte/auth

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

mostbyte/auth
=============

Mostbyte authorization system from identity service

4.3.1(3mo ago)0418↓50%MITPHPPHP ^8.4CI failing

Since Jan 17Pushed 3mo ago2 watchersCompare

[ Source](https://github.com/mostbyte/auth)[ Packagist](https://packagist.org/packages/mostbyte/auth)[ RSS](/packages/mostbyte-auth/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (6)Versions (44)Used By (0)

Mostbyte Auth
=============

[](#mostbyte-auth)

Authorization package for Laravel applications using Mostbyte Identity Service.

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

[](#requirements)

DependencyVersionPHP&gt;= 8.4Laravel11.x, 12.xVersion Compatibility
---------------------

[](#version-compatibility)

Laravel VersionPackage Version&lt; 10.x2.x11.x, 12.x3.xInstallation
------------

[](#installation)

Install via [Composer](https://getcomposer.org):

```
composer require mostbyte/auth
```

Or add manually to `composer.json`:

```
{
  "require": {
    "mostbyte/auth": "^3.0"
  }
}
```

Then run:

```
composer update
```

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

[](#configuration)

Publish the configuration file:

```
php artisan vendor:publish --provider="Mostbyte\Auth\AuthServiceProvider"
```

### Environment Variables

[](#environment-variables)

VariableDescriptionDefault`IDENTITY_BASE_URL`Identity service URL`https://auth.mostbyte.uz``LOCAL_DEVELOPMENT`Enable mock responses`true`> **Warning**Set `LOCAL_DEVELOPMENT=false` in production. Otherwise, all HTTP requests to the identity service will return fake responses.

Usage
-----

[](#usage)

### Basic Middleware Usage

[](#basic-middleware-usage)

```
use Mostbyte\Auth\Middleware\IdentityAuth;

Route::middleware(IdentityAuth::class)->get('/foo', function () {
    return 'bar';
});
```

### With No-Domain Parameter

[](#with-no-domain-parameter)

```
use Mostbyte\Auth\Middleware\IdentityAuth;

Route::middleware(IdentityAuth::using('no-domain'))->get('/foo', function () {
    return 'bar';
});
```

### Register as Alias

[](#register-as-alias)

In `bootstrap/app.php` (Laravel 11+):

```
->withMiddleware(function (Middleware $middleware) {
    $middleware->alias([
        'identity' => \Mostbyte\Auth\Middleware\IdentityAuth::class,
    ]);
})
```

Then use in routes:

```
Route::middleware('identity')->get('/foo', function () {
    return 'bar';
});
```

### Accessing Authenticated User

[](#accessing-authenticated-user)

```
// Get authenticated user
$user = auth()->user();

// Access relationships
$company = auth()->user()->company;
$role = auth()->user()->role;

// Get token
$token = auth()->user()->getToken();
```

License
-------

[](#license)

MIT

###  Health Score

49

—

FairBetter than 95% of packages

Maintenance79

Regular maintenance activity

Popularity15

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity76

Established project with proven stability

 Bus Factor1

Top contributor holds 95.5% 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 ~26 days

Recently: every ~0 days

Total

43

Last Release

111d ago

Major Versions

1.2.0 → 2.02023-08-21

2.0 → 3.02024-05-27

3.2.7 → 4.0.02026-01-21

3.3.1 → 4.2.02026-01-27

PHP version history (3 changes)1.0.0PHP ^8.0.2

3.0PHP ^8.2

4.0.0PHP ^8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/0edffe3f4edc190dc5f3b3649e38f7720ad12b76f6aeb6c1beeaf8d7ca342abb?d=identicon)[firdavsibodullaev](/maintainers/firdavsibodullaev)

---

Top Contributors

[![firdavsibodullaev](https://avatars.githubusercontent.com/u/59536101?v=4)](https://github.com/firdavsibodullaev "firdavsibodullaev (63 commits)")[![Dorsone](https://avatars.githubusercontent.com/u/84617193?v=4)](https://github.com/Dorsone "Dorsone (3 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mostbyte-auth/health.svg)

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

###  Alternatives

[spatie/laravel-health

Monitor the health of a Laravel application

86910.0M83](/packages/spatie-laravel-health)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[laravel/cashier-paddle

Cashier Paddle provides an expressive, fluent interface to Paddle's subscription billing services.

264778.4k3](/packages/laravel-cashier-paddle)[aedart/athenaeum

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

245.2k](/packages/aedart-athenaeum)[flarum/core

Delightfully simple forum software.

211.3M1.9k](/packages/flarum-core)[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)
