arkecosystem / fortify
该软件包已被放弃,不再维护。没有建议的替代软件包。
Laravel认证框架。由Laravel Fortify提供支持。
6.0.0
2021-09-29 01:58 UTC
Requires
- php: ^8.0
- arkecosystem/ui: ^5.0
- danharrin/livewire-rate-limiting: ^0.3.0
- illuminate/support: ^8.0
- jenssegers/agent: ^2.6
- laravel/fortify: ^1.8
- livewire/livewire: ^2.6
- pragmarx/google2fa-laravel: ^1.3
- spatie/laravel-medialibrary: ^9.7
- spatie/laravel-newsletter: ^4.10
- spatie/laravel-personal-data-export: ^3.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- graham-campbell/analyzer: ^3.0
- guzzlehttp/guzzle: ^7.3
- mockery/mockery: ^1.3
- nunomaduro/larastan: ^0.6
- nunomaduro/laravel-mojito: ^0.2
- orchestra/testbench: ^6.9
- pestphp/pest: ^1.0
- pestphp/pest-plugin-faker: ^1.0
- pestphp/pest-plugin-laravel: ^1.0
- pestphp/pest-plugin-livewire: ^1.0
- pestphp/pest-plugin-parallel: ^0.3.1
- phpunit/phpunit: ^9.5
- teamtnt/laravel-scout-tntsearch-driver: ^10.0
- dev-master
- 6.0.0
- 5.0.0
- 4.11.4
- 4.11.3
- 4.11.2
- 4.11.1
- 4.11.0
- 4.10.1
- 4.10.0
- 4.9.1
- 4.9.0
- 4.8.7
- 4.8.6
- 4.8.5
- 4.8.4
- 4.8.3
- 4.8.2
- 4.8.1
- 4.8.0
- 4.7.6
- 4.7.5
- 4.7.4
- 4.7.3
- 4.7.2
- 4.7.1
- 4.7.0
- 4.6.4
- 4.6.3
- 4.6.2
- 4.6.1
- 4.6.0
- 4.5.1
- 4.5.0
- 4.4.5
- 4.4.4
- 4.4.3
- 4.4.2
- 4.4.1
- 4.4.0
- 4.3.0
- 4.2.3
- 4.2.2
- 4.2.1
- 4.2.0
- 4.1.3
- 4.1.2
- 4.1.1
- 4.1.0
- 4.0.2
- 4.0.1
- 4.0.0
- 3.15.3
- 3.15.2
- 3.15.1
- 3.15.0
- 3.14.0
- 3.13.0
- 3.12.4
- 3.12.3
- 3.12.2
- 3.12.1
- 3.12.0
- 3.11.3
- 3.11.2
- 3.11.1
- 3.11.0
- 3.10.1
- 3.10.0
- 3.9.2
- 3.9.1
- 3.9.0
- 3.8.4
- 3.8.3
- 3.8.2
- 3.8.1
- 3.8.0
- 3.7.1
- 3.7.0
- 3.6.1
- 3.6.0
- 3.5.8
- 3.5.7
- 3.5.6
- 3.5.5
- 3.5.4
- 3.5.3
- 3.5.2
- 3.5.1
- 3.5.0
- 3.4.2
- 3.4.1
- 3.4.0
- 3.3.13
- 3.3.12
- 3.3.11
- 3.3.10
- 3.3.9
- 3.3.8
- 3.3.7
- 3.3.6
- 3.3.5
- 3.3.4
- 3.3.3
- 3.3.2
- 3.3.1
- 3.3.0
- 3.2.7
- 3.2.6
- 3.2.5
- 3.2.4
- 3.2.3
- 3.2.2
- 3.2.1
- 3.2.0
- 3.1.4
- 3.1.3
- 3.1.2
- 3.1.1
- 3.1.0
- 3.0.0
- 2.0.5
- 2.0.4
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
- 1.7.8
- 1.7.7
- 1.7.6
- 1.7.5
- 1.7.4
- 1.7.3
- 1.7.2
- 1.7.1
- 1.7.0
- 1.6.0
- 1.5.3
- 1.5.2
- 1.5.1
- 1.5.0
- 1.4.1
- 1.4.0
- 1.3.9
- 1.3.8
- 1.3.6
- 1.3.5
- 1.3.4
- 1.3.3
- 1.3.2
- 1.3.1
- 1.3.0
- 1.2.3
- 1.2.1
- 1.2.0
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.0
- dev-pages
This package is auto-updated.
Last update: 2021-10-29 02:14:52 UTC
README
Laravel认证框架。由Laravel Fortify提供支持。
安装
- 使用composer安装:
composer require arkecosystem/fortify
- 使用以下命令发布所有资产/视图:
php artisan vendor:publish --provider="ARKEcosystem\Fortify\FortifyServiceProvider" --tag=config --tag=images
。 - 禁用所有fortify软件包的自动发现。此步骤是必需的,这样我们就可以控制
laravel/fortify
和arkecosystem/fortify
的加载顺序。
"extra": { "laravel": { "dont-discover": ["arkecosystem/fortify", "laravel/fortify"] } },
- 所需图片
项目需要提供图片:resources/images/auth/verify-email.svg
此图片从fortify中省略,以防止被覆盖,但允许项目自定义。
将来,如果有多个实例需要图片,则配置文件可能是一个更好的选择。
- 按照此顺序注册服务提供者。这将确保我们的包可以覆盖
laravel/fortify
创建的任何绑定。
Laravel\Fortify\FortifyServiceProvider::class, ARKEcosystem\Fortify\FortifyServiceProvider::class,
- 使用
config/fortify.php
文件中的username_alt
设置启用或禁用用户名或电子邮件登录/注册
<?php return [ // ... 'username_alt' => 'username', // Or set that setting to `null` so the user can only login/register with email: // 'username_alt' => null, // ... ];
注意:如果您使用username_alt
设置,请确保您的用户表中已有该列。
注意:目前fortify打算与您的配置中的'username' => 'email'
一起使用,因为它在创建新用户时期望设置email
属性。
- 在
AppServiceProvider
中注册用于认证页面的数据包
use Konceiver\DataBags\DataBag; ... public function boot() { ... $this->registerDataBags(); } private function registerDataBags(): void { DataBag::register('fortify-content', [ 'register' => [ 'pageTitle' => '', 'title' => '', 'description' => '', ], 'login' => [ 'pageTitle' => '', 'title' => '', 'description' => '', // Optional // 'signupLink' => '', ], 'password' => [ 'reset' => [ 'pageTitle' => '', ], 'request' => [ 'pageTitle' => '', ], ], 'verification' => [ 'notice' => [ 'pageTitle' => '', ], 'verify' => [ 'pageTitle' => '', ], 'send' => [ 'pageTitle' => '', ], ], 'two-factor' => [ 'login' => [ 'pageTitle' => '', ], ], ]); }
双因素认证
底层我们使用Pragmarx Google2fa-laravel软件包。
对于如使用SVG渲染代替默认的Imagemagick生成QR-Code之类的自定义配置,您可以发布默认配置并根据需要调整。
- 将文件下载JS添加到Mix文件
.copy('vendor/arkecosystem/ui/resources/assets/js/file-download.js', 'public/js/file-download.js')
- 在需要它的任何页面上包含文件(例如账户设置)
@push('scripts') <script src="{{ mix('js/file-download.js')}}"></script> @endpush
- 构建资产
yarn prod
所需图片
密码确认模态框
密码确认模态框需要将图片添加到路径resources/images/auth/confirm-password.svg
,供使用该模态框的项目使用。