Complete Laravel authentication and admin starter kit with 18 layouts, Bootstrap 5.3.8, dark mode, and full Fortify integration with auto-registered services
artflow-studio/starterkit is a Laravel package for complete laravel authentication and admin starter kit with 18 layouts, bootstrap 5.3.8, dark mode, and full fortify integration with auto-registered services.
It currently has 0 GitHub stars and 8 downloads on Packagist (latest version 0.1.3).
Install it with composer require artflow-studio/starterkit.
Discover more Laravel packages by artflow-studio
or browse all Laravel packages to compare alternatives.
Last updated
Complete Laravel Authentication & Admin Starter Kit with Advanced Fortify Integration
14 Beautiful Auth Layouts | 5 Admin Layouts | Zero Build Required | Bootstrap 5.3.8 | Dark Mode | 20 Fortify Response Contracts | Role-Based Redirects | Complete Fortify Integration | Spatie Permission Support
A professional Laravel package with 14 authentication layouts, 5 admin dashboard layouts, Bootstrap 5.3.8, native dark mode, and complete Laravel Fortify integration including all 20 response contracts. Pre-built assets mean zero npm/build step required after installation!
php artisan starterkit:install does everythingThe package now implements all 20 Fortify response contracts, giving you total control over every authentication response:
Authentication Responses (4)
LoginResponse - Role-based redirects via AuthServiceRegisterResponse - Post-registration routing via AuthServiceLogoutResponse - Logout handlingTwoFactorLoginResponse - 2FA completion redirectsPassword Management (7)
PasswordResetResponse - After password resetPasswordUpdateResponse - After password changePasswordConfirmedResponse - Password confirmation successSuccessfulPasswordResetLinkRequestResponse - Reset link sentFailedPasswordResetLinkRequestResponse - Reset link failedFailedPasswordResetResponse - Reset failedFailedPasswordConfirmationResponse - Wrong passwordProfile Management (1)
ProfileInformationUpdatedResponse - Profile updatedTwo-Factor Authentication (5)
TwoFactorEnabledResponse - 2FA enabledTwoFactorDisabledResponse - 2FA disabledTwoFactorConfirmedResponse - 2FA confirmedRecoveryCodesGeneratedResponse - Recovery codes generatedFailedTwoFactorLoginResponse - Invalid 2FA codeEmail Verification (2)
VerifyEmailResponse - Email verifiedEmailVerificationNotificationSentResponse - Verification email sentRate Limiting (1)
LockoutResponse - Too many login attempts// Automatic Spatie Laravel Permission detection
AuthService::redirectAfterLogin($user)
β
Checks roles:
- admin? β /admin/dashboard
- moderator? β /moderator/dashboard
- manager? β /manager/dashboard
- else β /dashboard
All authentication logic is now properly organized in the package:
vendor/artflow-studio/starterkit/src/
βββ Http/
β βββ Responses/ β
20 Fortify response implementations
β β βββ LoginResponse.php
β β βββ RegisterResponse.php
β β βββ LogoutResponse.php
β β βββ TwoFactorLoginResponse.php
β β βββ PasswordResetResponse.php
β β βββ VerifyEmailResponse.php
β β βββ ... (14 more)
β βββ Middleware/
β βββ CustomAuthMiddleware.php
βββ Services/
β βββ AuthService.php β
Role-based auth logic
βββ Providers/
β βββ StarterKitFortifyServiceProvider.php β
Binds all 20 responses
βββ Console/
βββ InstallCommand.php β
Enhanced with --publish-auth-service
Important: These files are in the package only, not in your application. The install command optionally publishes AuthService to app/Services/ for customization.
# 1. Install via Composer
composer require artflow-studio/starterkit
# 2. Run installation command
php artisan starterkit:install
# 3. Start the server
php artisan serve
Then visit:
# Basic installation (default)
php artisan starterkit:install
# Choose auth layout during installation
php artisan starterkit:install --layout=glass
# Publish AuthService to app/Services for customization
php artisan starterkit:install --publish-auth-service
# Force overwrite existing files
php artisan starterkit:install --force
# Combine options
php artisan starterkit:install --publish-auth-service --force
The install command automatically:
config/starterkit.php)/test/layouts).env with STARTERKIT_AUTH_LAYOUT and STARTERKIT_ADMIN_LAYOUTapp/Services/ for customization# Run Laravel migrations
php artisan migrate
This creates the users table and related tables needed for authentication.
| Layout | Best For | Features | |--------|----------|----------| | particles | Modern feel | Animated particles, connecting lines | | centered | Classic login | Simple centered form | | split | Brand showcase | Side-by-side layout | | glass | Contemporary | Glassmorphism effect | | hero | Marketing | Large hero section | | modern | Professional | Contemporary design | | 3d | Creative | 3D effects | | premium-dark | Luxury | Dark theme | | gradient-flow | Dynamic | Animated gradients | | minimal | Clean | Ultra-simple | | clean | Business | Professional design | | hero-grid | Modern | Grid-based | | sidebar | Navigation | Sidebar style |
| Layout | Best For | Features | |--------|----------|----------| | sidebar | Dashboards | Collapsible sidebar | | topnav | Web apps | Horizontal navigation | | minimal | Analytics | Content-focused | | neo | Modern | Glassmorphic design | | classic | Enterprise | Traditional design |
# After installation, visit in browser:
http://localhost:8000/test/layouts
The package includes complete Fortify integration that's automatically registered:
User Action
β
Fortify Guard β CustomAuthMiddleware
β
Fortify Action (CreateNewUser, etc.)
β
AuthService Hook (business logic)
β
AuthenticationListener (events)
β
CustomAuthRedirectController (routing)
β
View Rendered with Layout
Override AuthService methods for custom logic:
// In app/Services/AuthService.php (published with install command)
public static function redirectAfterLogin($user)
{
if ($user->isAdmin()) {
return redirect('/admin/dashboard');
}
if (!$user->email_verified_at) {
return redirect('/email/verify');
}
return redirect('/dashboard');
}
All layouts support native Bootstrap dark mode:
<!-- Light theme (default) -->
<html data-bs-theme="light">
<!-- Dark theme -->
<html data-bs-theme="dark">
JavaScript to toggle:
function toggleTheme() {
const html = document.documentElement;
const current = html.getAttribute('data-bs-theme') || 'light';
const next = current === 'dark' ? 'light' : 'dark';
html.setAttribute('data-bs-theme', next);
localStorage.setItem('theme', next);
}
// Load saved theme
window.addEventListener('load', () => {
const saved = localStorage.getItem('theme');
if (saved) {
document.documentElement.setAttribute('data-bs-theme', saved);
}
});
The package implements all Fortify response contracts for complete control over authentication responses:
vendor/artflow-studio/starterkit/src/Http/Responses/
β
LoginResponse - Login success
β
RegisterResponse - Registration success
β
LogoutResponse - Logout
β
TwoFactorLoginResponse - 2FA login success
β
PasswordResetResponse - Password reset success
β
PasswordUpdateResponse - Password update
β
PasswordConfirmedResponse - Password confirmation
β
ProfileInformationUpdatedResponse - Profile update
β
VerifyEmailResponse - Email verification
β
TwoFactorEnabledResponse - 2FA enabled
β
TwoFactorDisabledResponse - 2FA disabled
β
TwoFactorConfirmedResponse - 2FA confirmed
β
RecoveryCodesGeneratedResponse - Recovery codes generated
β
SuccessfulPasswordResetLinkRequestResponse - Reset link sent
β
FailedPasswordResetLinkRequestResponse - Reset link failed
β
FailedPasswordResetResponse - Reset failed
β
FailedPasswordConfirmationResponse - Confirmation failed
β
FailedTwoFactorLoginResponse - 2FA failed
β
EmailVerificationNotificationSentResponse - Verification email sent
β
LockoutResponse - Rate limiting lockout
All responses are automatically bound in StarterKitFortifyServiceProvider:
// vendor/artflow-studio/starterkit/src/Providers/StarterKitFortifyServiceProvider.php
public function register(): void
{
// All 20 response contracts are bound here
$this->app->singleton(LoginResponse::class, StarterKitLoginResponse::class);
$this->app->singleton(RegisterResponse::class, StarterKitRegisterResponse::class);
// ... + 18 more
}
vendor/artflow-studio/starterkit/src/Services/AuthService.php
The AuthService provides centralized authentication logic:
// Role-based redirects (automatic Spatie support)
AuthService::redirectAfterLogin($user, $request)
// Post-registration routing
AuthService::redirectAfterRegister($user, $request)
// Password reset redirect
AuthService::redirectAfterPasswordReset($user)
// Pre-login validation
AuthService::beforeLogin($request)
// Post-login hooks
AuthService::afterLogin($user, $request)
// Post-registration hooks
AuthService::afterRegister($user, $request)
// Pre-logout validation
AuthService::beforeLogout($user)
// Post-logout hooks
AuthService::afterLogout($user)
// Check if 2FA required
AuthService::shouldRequireEmailVerification($user)
The AuthService automatically detects and uses Spatie roles:
public static function redirectAfterLogin(Model $user, ?Request $request = null): string
{
// Check if Spatie is available
if (method_exists($user, 'hasRole')) {
// Admin users
if ($user->hasRole('admin')) {
return '/admin/dashboard';
}
// Moderators
if ($user->hasRole('moderator')) {
return '/moderator/dashboard';
}
// Managers
if ($user->hasRole('manager')) {
return '/manager/dashboard';
}
}
// Default for all other users
return '/dashboard';
}
To customize the AuthService for your application:
php artisan starterkit:install --publish-auth-service
This creates:
app/Services/AuthService.php - Your customizable copyApp\ServicesUpdate these response files to use your published App\Services\AuthService:
vendor/artflow-studio/starterkit/src/Http/Responses/LoginResponse.phpvendor/artflow-studio/starterkit/src/Http/Responses/RegisterResponse.phpvendor/artflow-studio/starterkit/src/Http/Responses/TwoFactorLoginResponse.phpChange import from:
use ArtflowStudio\StarterKit\Services\AuthService;
To:
use App\Services\AuthService;
// app/Services/AuthService.php
namespace App\Services;
use ArtflowStudio\StarterKit\Services\AuthService as BaseAuthService;
use Illuminate\Database\Eloquent\Model;
class AuthService extends BaseAuthService
{
public static function redirectAfterLogin(Model $user, $request = null): string
{
// Premium users
if ($user->subscription_status === 'premium') {
return '/premium/dashboard';
}
// Fall back to base logic (Spatie roles, etc.)
return parent::redirectAfterLogin($user, $request);
}
}
Edit config/starterkit.php:
return [
'layouts' => [
'auth' => env('STARTERKIT_AUTH_LAYOUT', 'particles'),
'admin' => env('STARTERKIT_ADMIN_LAYOUT', 'sidebar'),
],
'dark_mode' => [
'enabled' => true,
'default' => 'light',
],
'assets' => [
'auth' => [
'css' => 'vendor/artflow-studio/starterkit/assets/auth.css',
'js' => 'vendor/artflow-studio/starterkit/assets/auth.js',
],
'admin' => [
'css' => 'vendor/artflow-studio/starterkit/assets/admin.css',
'js' => 'vendor/artflow-studio/starterkit/assets/admin.js',
],
],
];
STARTERKIT_AUTH_LAYOUT=glass # Default auth layout
STARTERKIT_ADMIN_LAYOUT=topnav # Default admin layout
STARTERKIT_DARK_MODE_ENABLED=true # Dark mode available
STARTERKIT_DARK_MODE_DEFAULT=light # Default theme
Edit config/starterkit.php:
return [
'layouts' => [
'auth' => env('STARTERKIT_AUTH_LAYOUT', 'particles'),
'admin' => env('STARTERKIT_ADMIN_LAYOUT', 'sidebar'),
],
'dark_mode' => [
'enabled' => true,
'default' => 'light',
],
'assets' => [
'auth' => [
'css' => 'vendor/artflow-studio/starterkit/assets/auth.css',
'js' => 'vendor/artflow-studio/starterkit/assets/auth.js',
],
'admin' => [
'css' => 'vendor/artflow-studio/starterkit/assets/admin.css',
'js' => 'vendor/artflow-studio/starterkit/assets/admin.js',
],
],
];
STARTERKIT_AUTH_LAYOUT=glass # Default auth layout
STARTERKIT_ADMIN_LAYOUT=topnav # Default admin layout
STARTERKIT_DARK_MODE_ENABLED=true # Dark mode available
STARTERKIT_DARK_MODE_DEFAULT=light # Default theme
# These publish automatically with: php artisan starterkit:install
php artisan vendor:publish --tag=starterkit-auth-layouts # Auth views (14 layouts)
php artisan vendor:publish --tag=starterkit-assets # CSS/JS files
php artisan vendor:publish --tag=starterkit-config # config/starterkit.php
# Admin layouts (not needed for basic auth)
php artisan vendor:publish --tag=starterkit-admin-layouts
# Database migrations
php artisan vendor:publish --tag=starterkit-migrations
# Documentation
php artisan vendor:publish --tag=starterkit-docs
# Fortify configuration (if you need to customize Fortify)
php artisan vendor:publish --tag=starterkit-fortify-config
<!-- resources/views/auth/login.blade.php -->
@extends('starterkit::layouts.auth.login')
@section('content')
<form method="POST" action="{{ route('login') }}">
@csrf
<div class="mb-3">
<label for="email" class="form-label">Email</label>
<input type="email" class="form-control" id="email" name="email" required>
</div>
<div class="mb-3">
<label for="password" class="form-label">Password</label>
<input type="password" class="form-control" id="password" name="password" required>
</div>
<button type="submit" class="btn btn-primary w-100">Sign In</button>
</form>
@endsection
<!-- resources/views/admin/dashboard.blade.php -->
@extends('starterkit::layouts.admin.sidebar')
@section('content')
<div class="container-fluid">
<h1>Admin Dashboard</h1>
<!-- Your admin content -->
</div>
@endsection
All layouts support native Bootstrap dark mode:
<!-- Light theme (default) -->
<html data-bs-theme="light">
<!-- Dark theme -->
<html data-bs-theme="dark">
JavaScript to toggle:
function toggleTheme() {
const html = document.documentElement;
const current = html.getAttribute('data-bs-theme') || 'light';
const next = current === 'dark' ? 'light' : 'dark';
html.setAttribute('data-bs-theme', next);
localStorage.setItem('theme', next);
}
// Load saved theme
window.addEventListener('load', () => {
const saved = localStorage.getItem('theme');
if (saved) {
document.documentElement.setAttribute('data-bs-theme', saved);
}
});
| Layout | Best For | Features | |--------|----------|----------| | particles | Modern feel | Animated particles, connecting lines | | centered | Classic login | Simple centered form | | split | Brand showcase | Side-by-side layout | | glass | Contemporary | Glassmorphism effect | | hero | Marketing | Large hero section | | modern | Professional | Contemporary design | | 3d | Creative | 3D effects | | premium-dark | Luxury | Dark theme | | gradient-flow | Dynamic | Animated gradients | | minimal | Clean | Ultra-simple | | clean | Business | Professional design | | hero-grid | Modern | Grid-based | | sidebar | Navigation | Sidebar style | | base | Minimal HTML | Base layout |
| Layout | Best For | Features | |--------|----------|----------| | sidebar | Dashboards | Collapsible sidebar | | topnav | Web apps | Horizontal navigation | | minimal | Analytics | Content-focused | | neo | Modern | Glassmorphic design | | classic | Enterprise | Traditional design |
# After installation, visit in browser:
http://localhost:8000/test/layouts
# Start server
php artisan serve
# Visit registration page
http://localhost:8000/register
# Register a new user - should redirect to /dashboard
// Create test users with roles
php artisan tinker
use App\Models\User;
use Spatie\Permission\Models\Role;
// Create roles
Role::create(['name' => 'admin']);
Role::create(['name' => 'moderator']);
// Create admin user
$admin = User::factory()->create(['email' => '[email protected]']);
$admin->assignRole('admin');
// Create moderator user
$mod = User::factory()->create(['email' => '[email protected]']);
$mod->assignRole('moderator');
Then login:
[email protected] β redirects to /admin/dashboard[email protected] β redirects to /moderator/dashboard/dashboardA: No! All assets are pre-compiled. Just run php artisan starterkit:install.
A: Yes! Run php artisan starterkit:install --publish-auth-service to get your own editable copy.
A: AuthService automatically detects Spatie Laravel Permission. Just assign roles to users and the redirects work automatically.
A: Yes! Update STARTERKIT_AUTH_LAYOUT in .env and refresh.
A: All users redirect to /dashboard by default. You can customize in AuthService.
A: Yes! All responses are in vendor/artflow-studio/starterkit/src/Http/Responses/. Each one can be customized.
/homeSolution:
php artisan config:clear
php artisan cache:clear
php artisan route:clear
Checklist:
composer show spatie/laravel-permissionphp artisan migrateUser::find(1)->getRoleNames()php artisan route:list --path=adminSolution:
composer dump-autoload
php artisan clear-compiled
php artisan config:clear
php artisan cache:clear
Verify binding:
php artisan tinker --execute="dd(app(Laravel\Fortify\Contracts\LoginResponse::class));"
Should output: ArtflowStudio\StarterKit\Http\Responses\LoginResponse
| Feature | Status | Details | |---------|--------|---------| | Fortify Response Contracts | β 20/20 | All contracts implemented | | Role-Based Redirects | β Built-in | Spatie automatic detection | | AuthService | β Available | In package, publishable | | Auth Layouts | β 14 layouts | Ready to use | | Admin Layouts | β 5 layouts | Pre-built | | Dark Mode | β Native | Bootstrap native | | Pre-Built Assets | β Yes | No npm/build needed | | One-Command Install | β Yes | Fully automated |
This package is open-sourced software licensed under the MIT license.
Contributions are welcome! Please feel free to submit pull requests.
For issues, questions, or suggestions, please open an issue on GitHub or contact the maintainers.
<!-- resources/views/dashboard.blade.php -->
@extends('starterkit::layouts.admin.sidebar')
@section('title', 'Dashboard')
@section('content')
<div class="container-fluid">
<h1>Welcome to Dashboard</h1>
<!-- Your content here -->
</div>
@endsection
// routes/web.php
Route::middleware(['custom-auth'])->group(function () {
Route::get('/dashboard', [DashboardController::class, 'index'])->name('dashboard');
Route::get('/admin', [AdminController::class, 'index'])->name('admin');
});
// app/Providers/EventServiceProvider.php
protected $listen = [
\Illuminate\Auth\Events\Login::class => [
\App\Listeners\AuthenticationListener::class,
],
\Illuminate\Auth\Events\Registered::class => [
\App\Listeners\AuthenticationListener::class,
],
\Illuminate\Auth\Events\Logout::class => [
\App\Listeners\AuthenticationListener::class,
],
];
package/
βββ src/
β βββ Console/
β β βββ InstallCommand.php # Main installation
β β βββ PublishCommand.php # Publishing helper
β β
β βββ Services/
β β βββ AuthService.php # Auth logic & hooks
β β
β βββ Http/
β β βββ Controllers/Auth/
β β β βββ CustomAuthRedirectController.php # Redirect logic
β β βββ Middleware/
β β βββ CustomAuthMiddleware.php # Route protection
β β
β βββ Listeners/
β β βββ AuthenticationListener.php # Event listeners
β β
β βββ Actions/Fortify/
β β βββ CreateNewUser.php # User creation
β β βββ CreateNewUserWithHooks.php # User creation with hooks
β β βββ UpdateUserPassword.php # Password updates
β β βββ UpdateUserProfileInformation.php # Profile updates
β β βββ ResetUserPassword.php # Password resets
β β βββ PasswordValidationRules.php # Validation
β β
β βββ Providers/
β β βββ StarterKitServiceProvider.php # Main provider
β β βββ StarterKitFortifyServiceProvider.php # Fortify setup
β β
β βββ StarterKitServiceProvider.php
β
βββ resources/
β βββ views/layouts/starterkit/
β β βββ auth/ # 13 authentication layouts
β β β βββ centered.blade.php
β β β βββ split.blade.php
β β β βββ glass.blade.php
β β β βββ particles.blade.php
β β β βββ hero.blade.php
β β β βββ modern.blade.php
β β β βββ 3d.blade.php
β β β βββ premium-dark.blade.php
β β β βββ gradient-flow.blade.php
β β β βββ minimal.blade.php
β β β βββ clean.blade.php
β β β βββ hero-grid.blade.php
β β β βββ sidebar.blade.php
β β β
β β βββ admin/ # 5 admin layouts
β β βββ sidebar.blade.php
β β βββ topnav.blade.php
β β βββ minimal.blade.php
β β βββ neo.blade.php
β β βββ classic.blade.php
β β
β βββ css/ (SCSS source for dev)
β
βββ public/vendor/artflow-studio/starterkit/
β βββ assets/ # Pre-built production assets
β βββ auth.css (257 KB)
β βββ auth.js
β βββ admin.css (235 KB)
β βββ admin.js
β
βββ config/
β βββ starterkit.php # Configuration
β
βββ database/
β βββ migrations/ # Database setup
β
βββ docs/
β βββ START_HERE.md
β βββ LAYOUTS_DOCUMENTATION.html
β βββ DARK_MODE_GUIDE.md
β βββ SCSS_COMPONENTS_GUIDE.md
β βββ FINAL_PROJECT_COMPLETION.md
β
βββ routes/
β βββ test-layouts.php # Layout testing routes
β
βββ composer.json # Package metadata
βββ README.md # This file
php artisan starterkit:install # Standard install
php artisan starterkit:install --layout=glass # Custom layout
php artisan starterkit:install --force # Overwrite existing
# Auto-published by install command:
php artisan vendor:publish --tag=starterkit-auth-layouts
php artisan vendor:publish --tag=starterkit-assets
php artisan vendor:publish --tag=starterkit-config
# Optional (not published by default):
php artisan vendor:publish --tag=starterkit-admin-layouts
php artisan vendor:publish --tag=starterkit-migrations
php artisan vendor:publish --tag=starterkit-docs
php artisan serve
# Visit: http://localhost:8000/test/layouts
All 18 layouts are displayed with live switching options.
php artisan test
php artisan optimize:clear
php artisan starterkit:install --force
ls public/vendor/artflow-studio/starterkit/assets/
php artisan vendor:publish --tag=starterkit-auth-layouts
ls resources/views/vendor/starterkit/layouts/
php artisan fortify:install
php artisan migrate
php artisan starterkit:install
chmod -R 755 storage bootstrap/cache
php artisan starterkit:install --force
git clone https://github.com/rahee554/Laravel-Starter-Kit.git
cd Laravel-Starter-Kit
composer install
npm install
cp .env.example .env
php artisan key:generate
php artisan migrate
php artisan serve
npm run dev
npm run build # Production build
php artisan test # Run tests
npm run test # JS tests
MIT License - Free to use in your projects!
For help:
docs/ directoryLAYOUTS_DOCUMENTATION.html/test/layouts routeAF Laravel Starter Kit
Ready to build secure Laravel applications with beautiful layouts? π
Start with AF Laravel Starter Kit today!