PHPackages                             artflow-studio/starterkit - 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. artflow-studio/starterkit

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

artflow-studio/starterkit
=========================

Complete Laravel authentication and admin starter kit with 18 layouts, Bootstrap 5.3.8, dark mode, and full Fortify integration with auto-registered services

0.1.3(5mo ago)08MITSCSSPHP ^8.1|^8.2|^8.3

Since Nov 25Pushed 5mo agoCompare

[ Source](https://github.com/rahee554/Laravel-Starter-Kit)[ Packagist](https://packagist.org/packages/artflow-studio/starterkit)[ RSS](/packages/artflow-studio-starterkit/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (3)Versions (3)Used By (0)

AF Laravel Starter Kit
======================

[](#af-laravel-starter-kit)

[![Latest Version](https://camo.githubusercontent.com/5239de4aa8a0e457cb3b4b799769202ed8d60662e9fc22ebffaf407fb930124f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d302e332e302d626c75652e737667)](https://github.com/artflow-studio/starterkit)[![Laravel](https://camo.githubusercontent.com/b72e0aa3b09f6ee9f1cd47f19792a8204408312803c6b277768a5d2c99ffd60c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d31322e782d7265642e737667)](https://laravel.com)[![Fortify](https://camo.githubusercontent.com/bebbeb935b787a7391e89e293324ce9e1dc5257e659c25ca1811dd38b160021e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f466f72746966792d4c61746573742d6f72616e67652e737667)](https://laravel.com/docs/fortify)[![Bootstrap](https://camo.githubusercontent.com/3e4075ab6f321ebd6c99853c8f823c3bb03bce61be62b2d95d693da2489de55f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f426f6f7473747261702d352e332e382d707572706c652e737667)](https://getbootstrap.com)[![PHP](https://camo.githubusercontent.com/5fe05c705bf034839bda7651781e4d0a9d42f4a840478ca5e343873a0361bb89/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e322b2d626c75652e737667)](https://php.net)[![License](https://camo.githubusercontent.com/8bb50fd2278f18fc326bf71f6e88ca8f884f72f179d3e555e20ed30157190d0d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e2e737667)](LICENSE.md)

**Complete Laravel Authentication &amp; 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!

---

✨ Key Features
--------------

[](#-key-features)

- 🎨 **19 Total Layouts** - 14 authentication + 5 admin professionally designed layouts
- 🌙 **Dark Mode** - Native Bootstrap dark mode with smooth transitions
- 📱 **Fully Responsive** - Mobile-first design, works on all devices
- 🚀 **Bootstrap 5.3.8** - Latest Bootstrap with custom form controls
- ⚡ **Pre-Built Assets** - No npm/build step required for installation!
- 🔐 **Complete Fortify Integration** - All 20 response contracts implemented
- 🛡️ **Role-Based Redirects** - Built-in Spatie Laravel Permission support
- 🎭 **Animated Effects** - Particles, gradients, and smooth transitions (pure CSS)
- 🎛️ **Customizable** - Easy to modify colors, layouts, and components
- 📚 **Complete Documentation** - Comprehensive docs and guides included
- 🧹 **Clean Installation** - Minimal setup, optional customizations available
- **✅ AuthService** - Centralized authentication logic with hooks
- **✅ 20 Response Contracts** - All Fortify responses fully implemented
- **✅ One-Command Installation** - `php artisan starterkit:install` does everything

---

🆕 What's New in v0.3
--------------------

[](#-whats-new-in-v03)

### Complete Fortify Response Contract Coverage

[](#complete-fortify-response-contract-coverage)

The package now implements **all 20 Fortify response contracts**, giving you total control over every authentication response:

#### ✅ All Response Contracts Implemented

[](#-all-response-contracts-implemented)

**Authentication Responses (4)**

- `LoginResponse` - Role-based redirects via AuthService
- `RegisterResponse` - Post-registration routing via AuthService
- `LogoutResponse` - Logout handling
- `TwoFactorLoginResponse` - 2FA completion redirects

**Password Management (7)**

- `PasswordResetResponse` - After password reset
- `PasswordUpdateResponse` - After password change
- `PasswordConfirmedResponse` - Password confirmation success
- `SuccessfulPasswordResetLinkRequestResponse` - Reset link sent
- `FailedPasswordResetLinkRequestResponse` - Reset link failed
- `FailedPasswordResetResponse` - Reset failed
- `FailedPasswordConfirmationResponse` - Wrong password

**Profile Management (1)**

- `ProfileInformationUpdatedResponse` - Profile updated

**Two-Factor Authentication (5)**

- `TwoFactorEnabledResponse` - 2FA enabled
- `TwoFactorDisabledResponse` - 2FA disabled
- `TwoFactorConfirmedResponse` - 2FA confirmed
- `RecoveryCodesGeneratedResponse` - Recovery codes generated
- `FailedTwoFactorLoginResponse` - Invalid 2FA code

**Email Verification (2)**

- `VerifyEmailResponse` - Email verified
- `EmailVerificationNotificationSentResponse` - Verification email sent

**Rate Limiting (1)**

- `LockoutResponse` - Too many login attempts

### Advanced AuthService with Role-Based Redirects

[](#advanced-authservice-with-role-based-redirects)

```
// Automatic Spatie Laravel Permission detection
AuthService::redirectAfterLogin($user)
    ↓
    Checks roles:
    - admin? → /admin/dashboard
    - moderator? → /moderator/dashboard
    - manager? → /manager/dashboard
    - else → /dashboard
```

### Package File Structure

[](#package-file-structure)

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.

---

📦 Installation
--------------

[](#-installation)

### Quick Start (3 Steps)

[](#quick-start-3-steps)

```
# 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:

- **Login/Register:**
- **Layout Showcase:**

### Installation Options

[](#installation-options)

```
# 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
```

### What Gets Installed

[](#what-gets-installed)

The install command automatically:

1. ✅ Checks and installs Laravel Fortify (if needed)
2. ✅ Publishes 14 auth layouts
3. ✅ Publishes 5 admin layouts
4. ✅ Publishes pre-built CSS/JS assets (no npm build needed!)
5. ✅ Publishes configuration (`config/starterkit.php`)
6. ✅ Registers custom Fortify responses (20 contracts)
7. ✅ Sets up layout test routes (`/test/layouts`)
8. ✅ Updates `.env` with `STARTERKIT_AUTH_LAYOUT` and `STARTERKIT_ADMIN_LAYOUT`
9. ✅ Optionally publishes AuthService to `app/Services/` for customization

### Database Setup

[](#database-setup)

```
# Run Laravel migrations
php artisan migrate
```

This creates the users table and related tables needed for authentication.

---

🎨 Available Layouts
-------------------

[](#-available-layouts)

### Authentication Layouts (13 Options)

[](#authentication-layouts-13-options)

LayoutBest ForFeatures**particles**Modern feelAnimated particles, connecting lines**centered**Classic loginSimple centered form**split**Brand showcaseSide-by-side layout**glass**ContemporaryGlassmorphism effect**hero**MarketingLarge hero section**modern**ProfessionalContemporary design**3d**Creative3D effects**premium-dark**LuxuryDark theme**gradient-flow**DynamicAnimated gradients**minimal**CleanUltra-simple**clean**BusinessProfessional design**hero-grid**ModernGrid-based**sidebar**NavigationSidebar style### Admin Layouts (5 Options)

[](#admin-layouts-5-options)

LayoutBest ForFeatures**sidebar**DashboardsCollapsible sidebar**topnav**Web appsHorizontal navigation**minimal**AnalyticsContent-focused**neo**ModernGlassmorphic design**classic**EnterpriseTraditional design### Preview Layouts

[](#preview-layouts)

```
# After installation, visit in browser:
http://localhost:8000/test/layouts
```

---

🔐 Authentication Flow
---------------------

[](#-authentication-flow)

### How Fortify Integration Works

[](#how-fortify-integration-works)

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

```

### Extending Authentication

[](#extending-authentication)

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');
}
```

---

🌙 Dark Mode
-----------

[](#-dark-mode)

All layouts support native Bootstrap dark mode:

```

```

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);
    }
});
```

---

🔐 Fortify Response Contracts
----------------------------

[](#-fortify-response-contracts)

### All 20 Response Contracts Implemented

[](#all-20-response-contracts-implemented)

The package implements **all Fortify response contracts** for complete control over authentication responses:

#### Location

[](#location)

```
vendor/artflow-studio/starterkit/src/Http/Responses/

```

#### Complete Contract List

[](#complete-contract-list)

```
✅ 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

```

#### Automatic Binding

[](#automatic-binding)

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
}
```

---

🧠 AuthService - Role-Based Authentication
-----------------------------------------

[](#-authservice---role-based-authentication)

### Location

[](#location-1)

```
vendor/artflow-studio/starterkit/src/Services/AuthService.php

```

### Features

[](#features)

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)
```

### Built-In Spatie Laravel Permission Support

[](#built-in-spatie-laravel-permission-support)

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';
}
```

### Publishing AuthService

[](#publishing-authservice)

To customize the AuthService for your application:

```
php artisan starterkit:install --publish-auth-service
```

This creates:

- `app/Services/AuthService.php` - Your customizable copy
- Namespace: `App\Services`
- Instructions for updating response imports

### After Publishing

[](#after-publishing)

Update these response files to use your published `App\Services\AuthService`:

1. `vendor/artflow-studio/starterkit/src/Http/Responses/LoginResponse.php`
2. `vendor/artflow-studio/starterkit/src/Http/Responses/RegisterResponse.php`
3. `vendor/artflow-studio/starterkit/src/Http/Responses/TwoFactorLoginResponse.php`

Change import from:

```
use ArtflowStudio\StarterKit\Services\AuthService;
```

To:

```
use App\Services\AuthService;
```

### Custom Example

[](#custom-example)

```
// 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);
    }
}
```

---

⚙️ Configuration
----------------

[](#️-configuration)

### Default Configuration

[](#default-configuration)

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',
        ],
    ],
];
```

### Environment Variables

[](#environment-variables)

```
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
```

---

⚙️ Configuration
----------------

[](#️-configuration-1)

### Default Configuration

[](#default-configuration-1)

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',
        ],
    ],
];
```

### Environment Variables

[](#environment-variables-1)

```
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
```

---

🛠️ Publishing Tags
------------------

[](#️-publishing-tags)

### Default Publishing (Automatic)

[](#default-publishing-automatic)

```
# 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
```

### Optional Publishing

[](#optional-publishing)

```
# 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
```

---

🎯 Usage Examples
----------------

[](#-usage-examples)

### Use Authentication Layout

[](#use-authentication-layout)

```

@extends('starterkit::layouts.auth.login')

@section('content')

        @csrf

            Email

            Password

        Sign In

@endsection
```

### Use Admin Layout

[](#use-admin-layout)

```

@extends('starterkit::layouts.admin.sidebar')

@section('content')

        Admin Dashboard

@endsection
```

---

🌙 Dark Mode
-----------

[](#-dark-mode-1)

All layouts support native Bootstrap dark mode:

```

```

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);
    }
});
```

---

🎨 Available Layouts
-------------------

[](#-available-layouts-1)

### Authentication Layouts (14 Options)

[](#authentication-layouts-14-options)

LayoutBest ForFeatures**particles**Modern feelAnimated particles, connecting lines**centered**Classic loginSimple centered form**split**Brand showcaseSide-by-side layout**glass**ContemporaryGlassmorphism effect**hero**MarketingLarge hero section**modern**ProfessionalContemporary design**3d**Creative3D effects**premium-dark**LuxuryDark theme**gradient-flow**DynamicAnimated gradients**minimal**CleanUltra-simple**clean**BusinessProfessional design**hero-grid**ModernGrid-based**sidebar**NavigationSidebar style**base**Minimal HTMLBase layout### Admin Layouts (5 Options)

[](#admin-layouts-5-options-1)

LayoutBest ForFeatures**sidebar**DashboardsCollapsible sidebar**topnav**Web appsHorizontal navigation**minimal**AnalyticsContent-focused**neo**ModernGlassmorphic design**classic**EnterpriseTraditional design### Preview Layouts

[](#preview-layouts-1)

```
# After installation, visit in browser:
http://localhost:8000/test/layouts
```

---

🧪 Testing Authentication
------------------------

[](#-testing-authentication)

### Test Registration &amp; Role-Based Redirect

[](#test-registration--role-based-redirect)

```
# Start server
php artisan serve

# Visit registration page
http://localhost:8000/register

# Register a new user - should redirect to /dashboard
```

### Test Role-Based Login

[](#test-role-based-login)

```
// 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' => 'admin@test.com']);
$admin->assignRole('admin');

// Create moderator user
$mod = User::factory()->create(['email' => 'mod@test.com']);
$mod->assignRole('moderator');
```

Then login:

- `admin@test.com` → redirects to `/admin/dashboard`
- `mod@test.com` → redirects to `/moderator/dashboard`
- Other users → redirects to `/dashboard`

---

❓ FAQ
-----

[](#-faq)

### Q: Do I need npm/build step?

[](#q-do-i-need-npmbuild-step)

**A:** No! All assets are pre-compiled. Just run `php artisan starterkit:install`.

### Q: Can I customize the AuthService?

[](#q-can-i-customize-the-authservice)

**A:** Yes! Run `php artisan starterkit:install --publish-auth-service` to get your own editable copy.

### Q: How do I use with Spatie roles?

[](#q-how-do-i-use-with-spatie-roles)

**A:** AuthService automatically detects Spatie Laravel Permission. Just assign roles to users and the redirects work automatically.

### Q: Can I change layouts dynamically?

[](#q-can-i-change-layouts-dynamically)

**A:** Yes! Update `STARTERKIT_AUTH_LAYOUT` in `.env` and refresh.

### Q: What if I don't use roles?

[](#q-what-if-i-dont-use-roles)

**A:** All users redirect to `/dashboard` by default. You can customize in AuthService.

### Q: Are the responses extensible?

[](#q-are-the-responses-extensible)

**A:** Yes! All responses are in `vendor/artflow-studio/starterkit/src/Http/Responses/`. Each one can be customized.

---

🚨 Troubleshooting
-----------------

[](#-troubleshooting)

### Issue: Still redirecting to `/home`

[](#issue-still-redirecting-to-home)

**Solution:**

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

### Issue: Role redirects not working

[](#issue-role-redirects-not-working)

**Checklist:**

1. Is Spatie installed? `composer show spatie/laravel-permission`
2. Did you run migrations? `php artisan migrate`
3. Does user have role? `User::find(1)->getRoleNames()`
4. Do routes exist? `php artisan route:list --path=admin`

### Issue: "Class not found" errors

[](#issue-class-not-found-errors)

**Solution:**

```
composer dump-autoload
php artisan clear-compiled
php artisan config:clear
php artisan cache:clear
```

### Issue: Response not binding

[](#issue-response-not-binding)

**Verify binding:**

```
php artisan tinker --execute="dd(app(Laravel\Fortify\Contracts\LoginResponse::class));"
```

Should output: `ArtflowStudio\StarterKit\Http\Responses\LoginResponse`

---

📚 Additional Resources
----------------------

[](#-additional-resources)

- **Fortify Documentation:**
- **Spatie Permission:**
- **Bootstrap Documentation:**
- **Package Repository:**

---

📝 Summary
---------

[](#-summary)

FeatureStatusDetails**Fortify Response Contracts**✅ 20/20All contracts implemented**Role-Based Redirects**✅ Built-inSpatie automatic detection**AuthService**✅ AvailableIn package, publishable**Auth Layouts**✅ 14 layoutsReady to use**Admin Layouts**✅ 5 layoutsPre-built**Dark Mode**✅ NativeBootstrap native**Pre-Built Assets**✅ YesNo npm/build needed**One-Command Install**✅ YesFully automated---

📄 License
---------

[](#-license)

This package is open-sourced software licensed under the [MIT license](LICENSE.md).

---

🤝 Contributing
--------------

[](#-contributing)

Contributions are welcome! Please feel free to submit pull requests.

---

📧 Support
---------

[](#-support)

For issues, questions, or suggestions, please open an issue on GitHub or contact the maintainers.

```

@extends('starterkit::layouts.admin.sidebar')

@section('title', 'Dashboard')

@section('content')

        Welcome to Dashboard

@endsection
```

### Custom Middleware

[](#custom-middleware)

```
// 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');
});
```

### Handle Auth Events

[](#handle-auth-events)

```
// 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 Structure
-------------------

[](#-package-structure)

```
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

```

---

📋 All Available Commands
------------------------

[](#-all-available-commands)

### Installation

[](#installation)

```
php artisan starterkit:install                    # Standard install
php artisan starterkit:install --layout=glass     # Custom layout
php artisan starterkit:install --force            # Overwrite existing
```

### Publishing

[](#publishing)

```
# 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
```

---

🧪 Testing
---------

[](#-testing)

### Manual Layout Testing

[](#manual-layout-testing)

```
php artisan serve
# Visit: http://localhost:8000/test/layouts
```

All 18 layouts are displayed with live switching options.

### Unit Tests

[](#unit-tests)

```
php artisan test
```

---

🐛 Troubleshooting
-----------------

[](#-troubleshooting-1)

### Assets Not Loading

[](#assets-not-loading)

```
php artisan optimize:clear
php artisan starterkit:install --force
ls public/vendor/artflow-studio/starterkit/assets/
```

### Layouts Not Showing

[](#layouts-not-showing)

```
php artisan vendor:publish --tag=starterkit-auth-layouts
ls resources/views/vendor/starterkit/layouts/
```

### Fortify Not Working

[](#fortify-not-working)

```
php artisan fortify:install
php artisan migrate
php artisan starterkit:install
```

### Permission Issues

[](#permission-issues)

```
chmod -R 755 storage bootstrap/cache
php artisan starterkit:install --force
```

---

🔧 Requirements
--------------

[](#-requirements)

- **PHP**: 8.1+
- **Laravel**: 11.x
- **Laravel Fortify**: ^1.17
- **Bootstrap**: 5.3.8
- **Composer**: 2.x+

---

📊 What's Included
-----------------

[](#-whats-included)

### ✅ Layouts (18 Total)

[](#-layouts-18-total)

- 13 authentication layouts (responsive, dark mode)
- 5 admin dashboard layouts (responsive, dark mode)

### ✅ Assets (Pre-built)

[](#-assets-pre-built)

- Auth CSS (257 KB) + JS (4 KB)
- Admin CSS (235 KB) + JS (4 KB)
- Bootstrap 5.3.8 integration
- Zero build required!

### ✅ Services

[](#-services)

- AuthService with complete hook system
- CustomAuthMiddleware for route protection
- AuthenticationListener for events
- 6 Fortify actions with customization

### ✅ Documentation

[](#-documentation)

- Interactive layout showcase
- Quick start guide
- Dark mode implementation guide
- Complete Fortify integration docs
- SCSS components reference

### ✅ Database

[](#-database)

- User table migrations
- Auth tables setup

---

🚀 Development
-------------

[](#-development)

### Local Setup

[](#local-setup)

```
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
```

### Build Commands

[](#build-commands)

```
npm run build           # Production build
php artisan test        # Run tests
npm run test            # JS tests
```

---

📄 License
---------

[](#-license-1)

MIT License - Free to use in your projects!

---

🤝 Support
---------

[](#-support-1)

For help:

1. Check `docs/` directory
2. Review `LAYOUTS_DOCUMENTATION.html`
3. Visit `/test/layouts` route
4. Check Laravel Fortify docs

---

📊 Package Information
---------------------

[](#-package-information)

**AF Laravel Starter Kit**

- **Version**: 0.2.0 (with Fortify integration)
- **Laravel**: 11.x+
- **PHP**: 8.1+
- **Bootstrap**: 5.3.8
- **License**: MIT
- **Repository**:
- **Owner**: rahee554

---

**Ready to build secure Laravel applications with beautiful layouts?** 🚀

Start with **AF Laravel Starter Kit** today!

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance70

Regular maintenance activity

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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

2

Last Release

174d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/998661a880df4a5ad4fc597f7e6c28e5a11047707b58ac7bb171916aacf65253?d=identicon)[rahee554](/maintainers/rahee554)

---

Top Contributors

[![rahee554](https://avatars.githubusercontent.com/u/76494683?v=4)](https://github.com/rahee554 "rahee554 (3 commits)")

---

Tags

laravellaravel 11Authenticationbootstrapstarter-kitadmin-paneldark-modefortifylayouts

### Embed Badge

![Health badge](/badges/artflow-studio-starterkit/health.svg)

```
[![Health](https://phpackages.com/badges/artflow-studio-starterkit/health.svg)](https://phpackages.com/packages/artflow-studio-starterkit)
```

###  Alternatives

[pragmarx/google2fa-laravel

A One Time Password Authentication package, compatible with Google Authenticator.

1.0k15.5M63](/packages/pragmarx-google2fa-laravel)[jacopo/laravel-authentication-acl

Laravel authentication and ACL package with a cool admin panel

28410.3k3](/packages/jacopo-laravel-authentication-acl)

PHPackages © 2026

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