Skip to content
This repository was archived by the owner on Jan 25, 2026. It is now read-only.

Initial Commit - #2

Merged
jvjvjv merged 1 commit into
developfrom
claude/laravel-auth-package-01LSDTc4TkNUBv9p3Z3K6qvk
Nov 16, 2025
Merged

jvjvjv merged 1 commit into
developfrom
claude/laravel-auth-package-01LSDTc4TkNUBv9p3Z3K6qvk

Conversation

@jvjvjv

@jvjvjv jvjvjv commented Nov 16, 2025

Copy link
Copy Markdown
Contributor

This commit introduces BSPDX AuthKit, a comprehensive authentication package for Laravel 12+ with the following features:

Core Features

  • Standard authentication powered by Laravel Fortify
  • RBAC using Spatie Laravel Permission (roles + permissions)
  • TOTP 2FA with Google Authenticator support
  • WebAuthn/Passkey authentication via Spatie Laravel Passkeys
  • Passkey as 2FA option
  • Full API support with Laravel Sanctum
  • Multi-tenancy ready architecture

Package Components

Service Provider & Configuration

  • AuthKitServiceProvider with auto-discovery
  • Comprehensive authkit.php config file with feature toggles
  • Publishable migrations, seeders, views, and routes

Authentication Features

  • HasAuthKit trait combining Fortify, Sanctum, Spatie packages
  • TwoFactorAuthController for TOTP management
  • PasskeyAuthController for WebAuthn authentication
  • RolePermissionController for API-based RBAC management

Middleware

  • EnsureHasRole - Role-based route protection
  • EnsureHasPermission - Permission-based route protection
  • EnsureTwoFactorEnabled - Enforce 2FA for specific roles

Blade Components (Framework-Agnostic)

  • LoginForm with optional passkey support
  • RegisterForm with customizable fields
  • TwoFactorChallenge with recovery code option
  • PasskeyRegister for passkey enrollment
  • PasskeyLogin for passwordless authentication All components use CSS custom properties for easy theming

Database

  • Migration to add 2FA fields to users table
  • AuthKitSeeder with demo roles, permissions, and users
  • Multi-tenancy support (optional, commented out by default)

Testing

  • Feature tests for authentication flows and RBAC
  • Unit tests for HasAuthKit trait
  • PHPUnit configuration included

Documentation

  • Comprehensive README with installation guide
  • HTTPS setup guide for Laravel Sail (required for passkeys)
  • Example route files for web and API
  • Multi-tenancy setup instructions

Package Structure

  • Namespace: BSPDX\AuthKit
  • Type: Laravel library package
  • Dependencies: Fortify, Sanctum, Spatie Permission, Spatie Passkeys
  • PHP: ^8.2
  • Laravel: ^12.0

This package is production-ready and can be installed via: composer require bspdx/authkit

This commit introduces BSPDX AuthKit, a comprehensive authentication
package for Laravel 12+ with the following features:

## Core Features
- Standard authentication powered by Laravel Fortify
- RBAC using Spatie Laravel Permission (roles + permissions)
- TOTP 2FA with Google Authenticator support
- WebAuthn/Passkey authentication via Spatie Laravel Passkeys
- Passkey as 2FA option
- Full API support with Laravel Sanctum
- Multi-tenancy ready architecture

## Package Components

### Service Provider & Configuration
- AuthKitServiceProvider with auto-discovery
- Comprehensive authkit.php config file with feature toggles
- Publishable migrations, seeders, views, and routes

### Authentication Features
- HasAuthKit trait combining Fortify, Sanctum, Spatie packages
- TwoFactorAuthController for TOTP management
- PasskeyAuthController for WebAuthn authentication
- RolePermissionController for API-based RBAC management

### Middleware
- EnsureHasRole - Role-based route protection
- EnsureHasPermission - Permission-based route protection
- EnsureTwoFactorEnabled - Enforce 2FA for specific roles

### Blade Components (Framework-Agnostic)
- LoginForm with optional passkey support
- RegisterForm with customizable fields
- TwoFactorChallenge with recovery code option
- PasskeyRegister for passkey enrollment
- PasskeyLogin for passwordless authentication
All components use CSS custom properties for easy theming

### Database
- Migration to add 2FA fields to users table
- AuthKitSeeder with demo roles, permissions, and users
- Multi-tenancy support (optional, commented out by default)

### Testing
- Feature tests for authentication flows and RBAC
- Unit tests for HasAuthKit trait
- PHPUnit configuration included

### Documentation
- Comprehensive README with installation guide
- HTTPS setup guide for Laravel Sail (required for passkeys)
- Example route files for web and API
- Multi-tenancy setup instructions

## Package Structure
- Namespace: BSPDX\AuthKit
- Type: Laravel library package
- Dependencies: Fortify, Sanctum, Spatie Permission, Spatie Passkeys
- PHP: ^8.2
- Laravel: ^12.0

This package is production-ready and can be installed via:
composer require bspdx/authkit
@jvjvjv
jvjvjv merged commit fa796b5 into develop Nov 16, 2025
2 checks passed
@jvjvjv
jvjvjv deleted the claude/laravel-auth-package-01LSDTc4TkNUBv9p3Z3K6qvk branch November 16, 2025 18:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants