devdojo / auth
auth 包让您在 Laravel 应用程序中轻松实现身份验证。
1.0.5
2024-09-20 12:33 UTC
Requires
- php: ^7.4|^8.0|^8.1|^8.2
- bacon/bacon-qr-code: ^3.0
- calebporzio/sushi: ^2.5
- codeat3/blade-phosphor-icons: ^2.0
- devdojo/config-writer: ^0.0.7
- illuminate/support: ^8.0|^9.0|^10.0|^11.0
- laravel/folio: ^1.0
- laravel/socialite: ^5.0
- livewire/livewire: ^3.0
- livewire/volt: ^1.0
- pragmarx/google2fa: ^8.0
Requires (Dev)
- alebatistella/duskapiconf: ^1.2
- larastan/larastan: ^2.0
- laravel/dusk: ^8.2
- laravel/pint: ^1.15
- orchestra/testbench: ^9.0
- pestphp/pest: ^2.34
- pestphp/pest-plugin-laravel: ^2.4
- phpstan/phpstan: ^1.11
- protonemedia/laravel-dusk-fakes: ^1.6
- dev-main
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- 0.0.24
- 0.0.23
- 0.0.22
- 0.0.21
- 0.0.20
- 0.0.19
- dev-updatingDocs
- dev-fix-social-providers-tags
- dev-fix-test-registers-a-new-user
- dev-fix_strict_models_social_creation
- dev-feature-login-remember-me
- dev-updatingTests
- dev-testTests
- dev-required-imagick-ext
- dev-container-alignment-fix
- dev-fix-google-login-callback-error
- dev-facebookSocialAuthFix
- dev-update-social-provider-user
- dev-updateUserModel
- dev-loginLayoutFix
- dev-duskTestUpdates
- dev-interfaceImprovements
- dev-fixingConditionalColumns
- dev-addingLighthouseTests
- dev-Add-Laravel-Pint
- dev-Auth-Tests-Workflow
- dev-fixingPreviewLinks
- dev-withFortify
- dev-workspace-help
- dev-main-bkup
- dev-newRestructure
- dev-restructure
This package is auto-updated.
Last update: 2024-09-20 12:37:12 UTC
README
关于
Auth 是任何 Laravel 应用程序 的即插即用身份验证包。
请访问官方文档 https://devdojo.com/auth/docs
安装
您可以将此包安装到任何新的 Laravel 应用程序中,或者安装任何可用的 Laravel Starter Kits。
composer require devdojo/auth
安装包后,您需要发布身份验证资产、配置等信息
php artisan vendor:publish --tag=auth:assets
php artisan vendor:publish --tag=auth:config
php artisan vendor:publish --tag=auth:ci
php artisan vendor:publish --tag=auth:migrations
接下来,运行迁移
php artisan migrate
最后,在您的 App\Models\User
模型中扩展 Devdojo 用户模型
use Devdojo\Auth\Models\User as AuthUser;
class User extends AuthUser
。
现在,您可以开始使用了!Auth 已经安装完成,您将能够访问以下身份验证路由
- 登录 (project.test/auth/login)
- 注册 (project.test/auth/register)
- 忘记密码 (project.test/auth/register)
- 密码重置 (project.test/auth/password/reset)
- 密码重置令牌 (project.test/auth/password/ReAlLyLoNgPaSsWoRdReSeTtOkEn)
- 密码确认 (project.test/auth/password/confirm)
- 双因素认证挑战 (project.test/auth/two-factor-challenge)
您还将有权访问双因素设置页面
- 双因素设置 (project.test/user/two-factor-authentication)
当您需要登出时,可以访问登出路由
- 登出路由 (project.test/auth/logout)
(可选) 添加 HasSocialProviders 特性。
您可以通过包含以下特性将所有社交身份验证助手添加到您的用户模型中
<?php namespace App\Models; use Devdojo\Auth\Traits\HasSocialProviders; // Import the trait class User extends Devdojo\Auth\Models\User { use HasSocialProviders; // Use the trait in the User model // Existing User model code... }
许可
DevDojo Auth 包是开源软件,采用 MIT 许可。