steelants/laravel-auth
最新稳定版本:1.1.7
Composer 安装命令:
composer require steelants/laravel-auth
包简介
Laravel Auth
README 文档
README
Currently WIP
Created by: SteelAnts s.r.o.
Install
- Artisan Command
install:auth
- add routes to web.php
Route::auth();
Optional Features
*Both features are disabled by default to avoid route collisions.
Email verification
- Protects routes with the
verifiedmiddleware and provides notice/verify/resend endpoints when enabled. - Requires
Route::auth(['verify' => true]);and theHandlesEmailVerificationplugin trait added to yourAuthControllernext toAuthentication.
MFA (TOTP)
- Adds TOTP setup/verification screens and enforces checks via the
verified.totpmiddleware. - Requires
Route::auth(['totp' => true]);and theHandlesTotpplugin trait added to yourAuthControllernext toAuthentication. - Install QR dependency in your app:
composer require endroid/qr-code.
Auth controller setup
Your AuthController pulls in the core auth trait, plus the plugin traits for optional features:
use SteelAnts\LaravelAuth\Traits\Authentication; use SteelAnts\LaravelAuth\Traits\HandlesEmailVerification; use SteelAnts\LaravelAuth\Traits\HandlesTotp; class AuthController extends Controller { use Authentication; use HandlesEmailVerification; // enable email verification flows use HandlesTotp; // enable TOTP MFA flows }
Development
-
Create subfolder
/packagesat root of your laravel project -
clone repository to sub folder
/packages(you need to be positioned at root of your laravel project in your terminal)
git clone https://github.com/steelants/laravel-auth.git ./packages/laravel-auth
- edit composer.json file
"autoload": { "psr-4": { "SteelAnts\\LaravelAuth\\": "packages/laravel-auth/src/" } }
- Add provider to
bootstrap/providers.php
return [ ... SteelAnts\LaravelAuth\AuthServiceProvider::class, ... ];
- aplicate packages changes
php artisan install:auth --force
Contributors
Other Packages
统计信息
- 总下载量: 3.21k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-02-08