gwl12345 / modern-auth
A modern authentication package for Laravel 12 + Inertia 2.3
Installs: 4
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Language:TypeScript
pkg:composer/gwl12345/modern-auth
Requires
- php: ^8.2
- illuminate/contracts: ^12.0
- illuminate/support: ^12.0
- inertiajs/inertia-laravel: ^2.0
- jenssegers/agent: ^2.6
- laragear/webauthn: ^4.0
README
A modern authentication package for Laravel 12 + Inertia 2.3, featuring:
- Tabbed Login: Standard Form, Magic Link, and WebAuthn (Passkeys).
- Profile Management: Update Info, Two-Factor Authentication, Browser Sessions, and Passkeys.
- Shadcn UI: Pre-styled components using Shadcn UI.
Prerequisites
- Laravel 12.x
- Inertia.js 2.x (React)
- Shadcn UI (installed in host app)
Installation
1. Require Package
If installing locally (development):
Add the repository to your application's composer.json:
"repositories": [ { "type": "path", "url": "../modern-auth" } ],
Then run:
composer require gwl12345/modern-auth
2. Install Resources
Publish the frontend files and migrations:
php artisan modern-auth:install
3. Install Dependencies
Install the required NPM packages:
npm install @laragear/webpass dayjs @radix-ui/react-tabs react-icons npm install class-variance-authority clsx tailwind-merge lucide-react sonner --save
4. Run Migrations
php artisan migrate
5. Build Assets
npm run build
Configuration
Service Provider
The package automatically registers its service provider.
Fortify
Ensure TwoFactorAuthentication is enabled in config/fortify.php if you wish to use the 2FA features.
Usage
- Login: The package overrides the standard login view. Visit
/login. - Profile: Access the profile settings at
/user/settings/profile. - Passkeys: Manage passkeys at
/user/settings/passkeys. - 2FA: Setup Two-Factor Authentication at
/user/settings/two-factor-authentication.
Frontend Integration
The package assumes your application has a layouts/app-layout and layouts/settings/layout (or you may need to adjust the imports in the published pages). All published pages are placed in resources/js/Pages/Auth and resources/js/Pages/Profile.