New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

jeffersongoncalves/laravel-admin

Separate Admin authenticatable model with its own guard, provider, password broker, migration, factory and observer for Laravel.
3,520 1
Install
composer require jeffersongoncalves/laravel-admin
Latest Version:1.0.2
PHP:^8.2
Laravel:12 · 13
Older releases:11
License:MIT
Last Updated:Oct 28, 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...

3,416 2
jeffersongoncalves/laravel-user

Base authenticatable User model, migration, factory and observer shared by the j...

3,593 1
dusterio/laravel-google-guard

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

350 6
leadout/jwt

Simple JWT authentication for Laravel.

4,719 0
jarnovanleeuwen/jwtapi-laravel

JWT API authentication driver (Guard) for Laravel.

2,853 0

Version History

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