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(5mo ago)0453↑56.3%MITPHPPHP ^8.4CI failing

Since Jan 17Pushed 5mo ago2 watchersCompare

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

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

46

—

FairBetter than 92% of packages

Maintenance72

Regular maintenance activity

Popularity12

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

159d 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://avatars.githubusercontent.com/u/59536101?v=4)[Firdavs](/maintainers/firdavsibodullaev)[@firdavsibodullaev](https://github.com/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

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[spatie/laravel-health

Monitor the health of a Laravel application

87512.0M167](/packages/spatie-laravel-health)[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M201](/packages/laravel-ai)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M131](/packages/roots-acorn)[illuminate/queue

The Illuminate Queue package.

21332.6M1.6k](/packages/illuminate-queue)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5022.0k](/packages/simplestats-io-laravel-client)

PHPackages © 2026

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