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

ActiveLibrary

ingenius/auth
=============

Authentication package for Ingenius

1.3.4(2mo ago)0926proprietaryPHPPHP ^8.1

Since Jul 24Pushed 2mo agoCompare

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

READMEChangelogDependencies (5)Versions (24)Used By (6)

Ingenius Auth Package
=====================

[](#ingenius-auth-package)

This package provides authentication functionality for the Ingenius platform, including:

- User authentication for tenants
- Role and permission management
- Middleware for tenant authentication and permission checks
- Helper functions for authentication

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

[](#installation)

```
composer require ingenius/auth
```

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

[](#configuration)

Publish the configuration file:

```
php artisan vendor:publish --tag=ingenius-auth-config
```

Migrations
----------

[](#migrations)

Publish the migrations:

```
php artisan vendor:publish --tag=ingenius-auth-migrations
```

Run the migrations:

```
php artisan migrate
```

Usage
-----

[](#usage)

### Authentication

[](#authentication)

```
use Ingenius\Auth\Helpers\AuthHelper;

// Get authenticated user from any guard
$user = AuthHelper::getUser();

// Check if user is authenticated in any guard
if (AuthHelper::check()) {
   // User is authenticated
}

// Get user from a specific guard
$tenantUser = AuthHelper::getUserFromGuard('tenant');
$sanctumUser = AuthHelper::getUserFromGuard('sanctum');
```

### Middleware

[](#middleware)

The package provides two middleware:

- `tenant.user`: Ensures the user is authenticated in the tenant context
- `tenant.permission`: Checks if the user has the required permission

```
// In your routes file
Route::middleware(['tenant.user'])->group(function () {
    Route::get('/dashboard', 'DashboardController@index');
});

Route::middleware(['tenant.user', 'tenant.permission:auth.users.view'])->group(function () {
    Route::get('/users', 'UserController@index');
});
```

### Commands

[](#commands)

The package provides the following commands:

- `ingenius:auth:sync-tenant-permissions`: Synchronizes permissions from the PermissionsManager to tenant databases
- `ingenius:auth:add-admin-role-to-user`: Adds an admin role to an existing user in a tenant and assigns all permissions to that role

```
# Sync permissions for all tenants
php artisan ingenius:auth:sync-tenant-permissions

# Sync permissions for a specific tenant
php artisan ingenius:auth:sync-tenant-permissions --tenant=1

# Add admin role to a user
php artisan ingenius:auth:add-admin-role-to-user 1 user@example.com
```

Testing
-------

[](#testing)

```
composer test
```

License
-------

[](#license)

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

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance84

Actively maintained with recent releases

Popularity10

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity55

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

Total

23

Last Release

82d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5382442d1d8cf8280c50b7a0f3204aa40ac529f412f98a3cdee286cebdd152e8?d=identicon)[Chicho93](/maintainers/Chicho93)

---

Top Contributors

[![Chicho2011](https://avatars.githubusercontent.com/u/13334041?v=4)](https://github.com/Chicho2011 "Chicho2011 (32 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[typicms/base

A modular multilingual CMS built with Laravel, enabling developers to manage structured content like pages, news, events, and more.

1.6k20.3k](/packages/typicms-base)[nasirkhan/laravel-starter

A CMS like modular Laravel starter project.

1.4k2.7k](/packages/nasirkhan-laravel-starter)

PHPackages © 2026

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