PHPackages                             saadmughal/admin-auth-php - 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. saadmughal/admin-auth-php

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

saadmughal/admin-auth-php
=========================

Admin authentication package for Laravel with Firebase notifications

v1.3.8(9mo ago)012MITPHPPHP ^8.0

Since Aug 19Pushed 9mo agoCompare

[ Source](https://github.com/saadey7/admin-auth-php)[ Packagist](https://packagist.org/packages/saadmughal/admin-auth-php)[ RSS](/packages/saadmughal-admin-auth-php/feed)WikiDiscussions main Synced 1mo ago

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

Admin Authentication Package for Laravel
========================================

[](#admin-authentication-package-for-laravel)

[![Latest Version on Packagist](https://camo.githubusercontent.com/fb128556c20805aa9a1356118712f075468a9eb206046a4c0406efbdda86bcb6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736161646d756768616c2f61646d696e2d617574682d7068702e737667)](https://packagist.org/packages/saadmughal/admin-auth-php)[![Total Downloads](https://camo.githubusercontent.com/3d2c4b4c7ae2b28bdc33fb3c665419a1f63875776913c65948286135f665931d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f736161646d756768616c2f61646d696e2d617574682d7068702e737667)](https://packagist.org/packages/saadmughal/admin-auth-php)[![License](https://camo.githubusercontent.com/0e20867dea08889ebc964e8f6814fb4887f5c2674d334394d06b6c65bff01aa8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f736161646d756768616c2f61646d696e2d617574682d7068702e737667)](https://packagist.org/packages/saadmughal/admin-auth-php)[![PHP Version Require](https://camo.githubusercontent.com/fa832bfde2ecbe3ba77f1f2a4d2dd860c3e06714415550bf37e3f3bc8dd3472b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f736161646d756768616c2f61646d696e2d617574682d7068702e737667)](https://www.php.net/)

A complete Admin Authentication package for Laravel. Features include:

1. 🔐 Admin login &amp; registration
2. 🔑 Password reset &amp; email verification
3. 🔔 Firebase push notifications for admins
4. ⚡ Ready-to-use routes, controllers, and views

🚀 Installation &amp; Setup
==========================

[](#-installation--setup)

1. Install via Composer
-----------------------

[](#1-install-via-composer)

```
composer require saadmughal/admin-auth-php
```

2. Register Service Provider
----------------------------

[](#2-register-service-provider)

This package uses manual provider registration (to avoid errors on removal).

Laravel 9 &amp; 10

Edit `config/app.php` and add to the providers array:

```
Mughal\AdminAuth\AdminAuthServiceProvider::class,
```

Laravel 11 &amp; above

Edit `bootstrap/providers.php`:

```
return [
    // other providers...
    Mughal\AdminAuth\AdminAuthServiceProvider::class,
];
```

3. Run Migrations
-----------------

[](#3-run-migrations)

```
php artisan migrate
```

4. Add Guard &amp; Provider
---------------------------

[](#4-add-guard--provider)

Add admin guard and provider in `config/auth.php`:

```
'guards' => [
    'admin' => [
        'driver' => 'session',
        'provider' => 'admins',
    ],
],
'providers' => [
    'admins' => [
        'driver' => 'eloquent',
        'model' => Mughal\AdminAuth\Models\Admin::class,
    ],
],
```

5. Dashboard Redirect
---------------------

[](#5-dashboard-redirect)

By default, after successful login, admins are redirected to `/admin`.
You can change this in `config/adminauth.php`:

```
'redirect_to' => '/dashboard',
```

After installing and migrating, you must define your own admin dashboard route.

Add this to `routes/web.php` in your Laravel project:

```
Route::middleware('auth:admin')->group(function () {
    Route::get('/dashboard', function () {
        return view('admin.dashboard');
    });
});
```

6. Publish Config
-----------------

[](#6-publish-config)

After installing, publish the config file:

```
php artisan vendor:publish --provider="Mughal\AdminAuth\AdminAuthServiceProvider" --tag=config
```

Firebase Notifications (Optional)
---------------------------------

[](#firebase-notifications-optional)

If you want to send notifications to admins, configure Firebase:

1. Add your Firebase JSON path in `.env`:

```
ADMIN_FIREBASE_JSON=/full/path/to/firebase_project.json
```

2. Save the admin’s FCM token when they log in
3. If you have added the Firebase JSON file path in your .env file and the FCM token is being stored in the database, you can use the below function to send notifications to admins.

```
use Mughal\AdminAuth\Models\Admin;

$admin = Admin::first();
$data = [
    'title' => 'New Alert',
    'body' => 'You have a new notification!',
    'description' => 'Notification details',
    'type' => 'info'
];
$message = "Check your dashboard";

$admin->sendNotification($admin->id, $data, $message);
```

Visit in your browser:
----------------------

[](#visit-in-your-browser)

```
http://localhost:8000/admin/login
http://localhost:8000/admin/register
```

🗑️ Removal / Uninstall
======================

[](#️-removal--uninstall)

To uninstall cleanly without errors:

1. Remove provider entry 1.1 Laravel 9 &amp; 10 → remove from config/app.php 1.2 Laravel 11 → remove from bootstrap/providers.php
2. Remove the package

```
composer remove saadmughal/admin-auth-php
```

3. Clear caches

```
php artisan config:clear
php artisan route:clear
php artisan view:clear
php artisan cache:clear
```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance58

Moderate activity, may be stable

Popularity5

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

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

Total

11

Last Release

271d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/76b114a63416abc12933018ca72fcff1c2e06b07f5928be801267adf15e99abf?d=identicon)[saadey7](/maintainers/saadey7)

### Embed Badge

![Health badge](/badges/saadmughal-admin-auth-php/health.svg)

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

###  Alternatives

[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)[olssonm/l5-very-basic-auth

Laravel stateless HTTP basic auth without the need for a database

1662.5M1](/packages/olssonm-l5-very-basic-auth)[stechstudio/laravel-jwt

Helper package that makes it easy to generate, consume, and protect routes with JWT tokens in Laravel

126117.6k](/packages/stechstudio-laravel-jwt)[scaler-tech/laravel-saml2

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

2737.5k](/packages/scaler-tech-laravel-saml2)[truckersmp/steam-socialite

Laravel Socialite provider for Steam OpenID.

1516.7k](/packages/truckersmp-steam-socialite)

PHPackages © 2026

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