gwl12345/modern-auth
最新稳定版本:v1.0.5
Composer 安装命令:
composer require gwl12345/modern-auth
包简介
A modern authentication package for Laravel 12 + Inertia 2.3
README 文档
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.
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-12-17