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

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

kianisanaullah/central-auth
===========================

Central/shared DB users &amp; roles for Laravel (configurable connection/tables).

v1.0.0(4mo ago)043MITPHPPHP ^8.2

Since Feb 13Pushed 4mo agoCompare

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

READMEChangelogDependencies (3)Versions (2)Used By (0)

Central Auth — Shared Users &amp; Roles for Laravel

A lightweight package to use a centralized users/roles database across multiple Laravel projects or subdomains.

Perfect for organizations running many apps that need: • Single source of truth for users • Central role management • Seamless integration into new projects • Optional read-only access from apps • Role-based middleware

⸻

✨ Features • 🔐 Central users &amp; roles from shared DB

```
•	🧩 Plug-and-play integration

•	⚙️ Fully configurable (connection, tables, columns)

•	🧠 Works with existing Laravel Auth

•	🛡 Role-based middleware (central.role)

•	🔄 Environment-driven model switching

•	🚫 No code changes required per project (if using AUTH_MODEL)

```

⸻

📦 Installation

1. Require package

```
composer require kianisanaullah/central-auth
```

2. Publish config

```
php artisan vendor:publish --tag=central-auth-config
php artisan optimize:clear
```

⚙️ Configuration

Add central DB connection

In your app config/database.php:

```
'mysql_auth' => [
    'driver' => 'mysql',
    'host' => env('AUTH_DB_HOST'),
    'port' => env('AUTH_DB_PORT', 3306),
    'database' => env('AUTH_DB_DATABASE'),
    'username' => env('AUTH_DB_USERNAME'),
    'password' => env('AUTH_DB_PASSWORD'),
    'charset' => 'utf8mb4',
    'collation' => 'utf8mb4_unicode_ci',
    'prefix' => '',
    'strict' => false,
],
```

Environment variables

```
# Enable central auth
CENTRAL_AUTH_ENABLED=true

# Use shared DB connection
CENTRAL_AUTH_SHARED_DB=true
CENTRAL_AUTH_CONNECTION=mysql_auth

# DB credentials (read-only recommended)
AUTH_DB_HOST=127.0.0.1
AUTH_DB_PORT=3306
AUTH_DB_DATABASE=central_auth
AUTH_DB_USERNAME=auth_app_test
AUTH_DB_PASSWORD=********

# Tell Laravel to use CentralUser model
AUTH_MODEL=Kiani\CentralAuth\Models\CentralUser
```

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance74

Regular maintenance activity

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity47

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

Unknown

Total

1

Last Release

140d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c0cccd1ca113e6587b72a3e79bdb638b7311b1966157b376fe9366b700d015e6?d=identicon)[kianisanaullah](/maintainers/kianisanaullah)

---

Top Contributors

[![kianisanaullah](https://avatars.githubusercontent.com/u/28821509?v=4)](https://github.com/kianisanaullah "kianisanaullah (3 commits)")

### Embed Badge

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

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

###  Alternatives

[spatie/laravel-permission

Permission handling for Laravel 12 and up

12.9k102.4M1.4k](/packages/spatie-laravel-permission)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k15.1M132](/packages/laravel-pulse)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M131](/packages/roots-acorn)[hasinhayder/tyro

Tyro - The ultimate Authentication, Authorization, and Role &amp; Privilege Management solution for Laravel 12 &amp; 13

6804.7k6](/packages/hasinhayder-tyro)[api-platform/laravel

API Platform support for Laravel

58171.5k14](/packages/api-platform-laravel)

PHPackages © 2026

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