winnie / laravelchangepassword
: Laravel 框架更改密码功能。
v1.3
2020-10-17 08:04 UTC
Requires
- illuminate/support: ^5.5 || ^6.0 || ^7.0 || ^8.0
- yoeunes/toastr: ^1.2
Requires (Dev)
- mockery/mockery: ^1.1
- orchestra/testbench: ~3|~4
- phpunit/phpunit: ^8.0
- sempro/phpunit-pretty-print: ^1.0
README
Laravel 框架更改密码功能。我假设你使用了内置的 Laravel 身份验证 / Laravel UI。
安装
- 通过 Composer 安装包
$ composer require winnie/laravelchangepassword
- 然后将服务提供者添加到
config/app.php。在 Laravel 5.5 及以上版本中,如果启用了包自动发现,则可以跳过此步骤。
'providers' => [ ... Winnie\LaravelChangePassword\LaravelChangePasswordServiceProvider::class ... ];
- 发布配置文件
$ php artisan vendor:publish --provider="Winnie\LaravelChangePassword\LaravelChangePasswordServiceProvider"
用法
将以下内容添加到你的 routes/web.php
LaravelChangePassword::routes();
你可以访问此路由来更改密码 你的网站/password/change
你也可以使用此路由名称
{{ route('password.change') }}
示例
<a class="dropdown-item" href="{{ route('password.change') }}"> {{ __('Change Password') }} </a>
你可以编辑配置文件来更改设置,文件位于 config/laravelchangepassword.php。
<?php return [ // Redirect after changing password to 'redirect_to' => '/home', // Enable current password field 'enable_current_password' => true, // Validation error message. 'current_password_error_msg' => 'Your current password is incorrect.', // ALert success message 'current_password_success_msg' => 'Password change successfully!', ];
如果你想要覆盖视图,请导航到 resources/views/vendor/winnie/auth/passwords/change.blade.php
如果你想要添加美观的提示通知,请添加以下 blade 指令。
<!doctype html> <html> <head> <title>Toastr.js</title> @toastr_css </head> <body> </body> @jquery @toastr_js @toastr_render </html>
变更日志
请参阅 变更日志 了解最近的变化信息。
待办事项
创建测试
测试
$ composer test
贡献
请参阅 contributing.md 了解详细信息和待办事项列表。
安全性
如果你发现任何安全问题,请通过电子邮件联系作者,而不是使用问题跟踪器。
致谢
许可
MIT.
