jeffersongoncalves/laravel-admin

Separate Admin authenticatable model with its own guard, provider, password broker, migration, factory and observer for Laravel.
1,257 1
Install
composer require jeffersongoncalves/laravel-admin
Latest Version:1.0.1
PHP:^8.2
License:MIT
Last Updated:Sep 29, 2026
Links: GitHub  ·  Packagist
Maintainer: jeffersongoncalves

Laravel Admin

Laravel Admin

Separate Admin authenticatable model with its own admin guard, admins provider and password broker, plus migration, factory and observer.

Your app keeps its own App\Models\Admin and extends the package model, so admins live in their own table, fully apart from users.

Installation

composer require jeffersongoncalves/laravel-admin

Publish and run the migration:

php artisan vendor:publish --tag="laravel-admin-migrations"
php artisan migrate

Usage

namespace App\Models;

use JeffersonGoncalves\Admin\Models\Admin as BaseAdmin;

class Admin extends BaseAdmin
{
    // add traits, relations or overrides here
}

Point the admins provider to your model in config/auth.php:

'providers' => [
    // ...
    'admins' => [
        'driver' => 'eloquent',
        'model' => App\Models\Admin::class,
    ],
],

Guard, provider and password broker

The service provider registers these only when config/auth.php does not define them already (your config always wins):

Key Default
auth.guards.admin session driver, admins provider
auth.providers.admins eloquent, JeffersonGoncalves\Admin\Models\Admin
auth.passwords.admins admins provider, same token table as users, 60 min expiry/throttle
Auth::guard('admin')->attempt(['email' => $email, 'password' => $password, 'status' => true]);

What the base model gives you

Feature Details
Columns status, name, email, email_verified_at, password, remember_token, avatar_url, custom_fields, locale, theme_color
Casts password hashed, status boolean, custom_fields array, email_verified_at datetime
Factory Admin::factory() with unverified() and inactive() states. It creates the model set in auth.providers.admins.model
Observer Clears the admins_count cache key on create/delete (inherited by subclasses)

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Credits

License

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

Related Packages

jeffersongoncalves/filament-admin

Filament Admin model, AdminResource, status-aware Login page and plugin for a se...

1,172 2
lauroguedes/mary-ui-starter-kit

A modern Laravel starter kit featuring Livewire Volt, Mary UI, and Tailwind CSS...

239 38
canaan5/power

Full Administrative Package for laravel

29 5
dusterio/laravel-google-guard

Auth guard for Laravel that completely relies on Google Login and doesn't persis...

350 6

Version History

Version Released PHP Laravel License
1.0.1 ^8.2 ^12.61.1|^13.12.0 MIT
1.0.0 ^8.2 ^11.0|^12.0|^13.0 MIT