sakib-1996 / auth-admin
A self-contained Laravel authentication and admin dashboard package with login, registration, and a Tailwind-powered UI.
Requires
- php: ^8.2
- illuminate/auth: ^11.0|^12.0|^13.0
- illuminate/console: ^11.0|^12.0|^13.0
- illuminate/database: ^11.0|^12.0|^13.0
- illuminate/filesystem: ^11.0|^12.0|^13.0
- illuminate/routing: ^11.0|^12.0|^13.0
- illuminate/support: ^11.0|^12.0|^13.0
- illuminate/validation: ^11.0|^12.0|^13.0
- illuminate/view: ^11.0|^12.0|^13.0
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/pint: ^1.21
- orchestra/testbench: ^9.0|^10.0|^11.0
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^11.5
This package is not auto-updated.
Last update: 2026-07-21 04:03:23 UTC
README
A self-contained Laravel package that provides authentication (login, register, logout) and a Tailwind CSS admin dashboard UI.
Requirements
- PHP 8.2+
- Laravel 11, 12, or 13
- Node.js 18+ and npm (required to build frontend assets)
- A
userstable and User model in your Laravel application
Installation
Install via Composer:
composer require sakib-1996/auth-admin
Build and publish frontend assets:
php artisan auth-admin:install
This command runs npm install, npm run build inside the package, and copies compiled assets to public/vendor/auth-admin.
Optional: publish config
php artisan vendor:publish --tag=auth-admin-config
Optional: publish views for customization
php artisan vendor:publish --tag=auth-admin-views
Published views are placed in resources/views/vendor/auth-admin.
Usage
After installation, the following routes are available (default prefix auth-admin):
| Method | URI | Name |
|---|---|---|
| GET | /auth-admin/login |
auth-admin.login |
| POST | /auth-admin/login |
— |
| GET | /auth-admin/register |
auth-admin.register |
| POST | /auth-admin/register |
— |
| POST | /auth-admin/logout |
auth-admin.logout |
| GET | /auth-admin |
auth-admin.dashboard |
Visit /auth-admin/login to sign in.
Configuration
Configuration file: config/auth-admin.php (optional, publish first)
| Option | Default | Description |
|---|---|---|
route_prefix |
auth-admin |
URL prefix for all package routes |
middleware |
['web'] |
Middleware stack applied to package routes |
guard |
web |
Authentication guard |
user_model |
null |
User model class (falls back to auth.providers.users.model) |
users_table |
null |
Users table name (falls back to model table) |
redirect_after_login |
auth-admin.dashboard |
Route name after login |
redirect_after_logout |
auth-admin.login |
Route name after logout |
Using your existing User model
By default, the package uses your application's User model from config/auth.php. No extra setup is required if you already have a standard Laravel users table with name, email, and password columns.
Ensure your User model hashes passwords, for example:
protected function casts(): array { return [ 'password' => 'hashed', ]; }
Blade components
| Component | Description |
|---|---|
<x-auth-admin-guest-layout> |
Guest layout for login/register |
<x-auth-admin-layout> |
Admin dashboard layout |
<x-auth-admin-input> |
Reusable form input with validation errors |
<x-auth-admin-sidebar> |
Sidebar navigation |
<x-auth-admin-navbar> |
Top navigation bar |
Screenshots
Troubleshooting
Assets not loading
Run:
php artisan auth-admin:install
Ensure public/vendor/auth-admin/app.css and app.js exist.
Route [login] not defined
This package uses auth-admin.login, not Laravel's default login route. Protected package routes use auth-admin.auth middleware which redirects to the correct login route automatically.
Registration fails
Verify your users table exists and your User model has name, email, and password in $fillable (or uses #[Fillable]).
npm build fails
Ensure Node.js 18+ is installed and run the install command from your Laravel project root.
Upgrade guide
1.0.0
Initial stable release. Requires running php artisan auth-admin:install after install or upgrade.
Development
composer install
composer test
composer format
composer analyse
License
MIT © Abdullah Mohammad Sakib. See LICENSE.