winnie / laravelchangepassword
:Laravel framework change password functionality.
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 framework change password functionality. I assume you use built-in laravel authentication / laravel ui.
Installation
- Require the Package via Composer
$ composer require winnie/laravelchangepassword
- Then add the service provider to
config/app.php
. In Laravel versions 5.5 and beyond, this step can be skipped if package auto-discovery is enabled.
'providers' => [ ... Winnie\LaravelChangePassword\LaravelChangePasswordServiceProvider::class ... ];
- Publish the configuration file:
$ php artisan vendor:publish --provider="Winnie\LaravelChangePassword\LaravelChangePasswordServiceProvider"
Usage
Add this to your routes/web.php
LaravelChangePassword::routes();
You can visit this route for change password your-website/password/change
You can also use this route name
{{ route('password.change') }}
Example:
<a class="dropdown-item" href="{{ route('password.change') }}"> {{ __('Change Password') }} </a>
You can edit the config file to change settings at 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!', ];
If you want to override views, navigate to resources/views/vendor/winnie/auth/passwords/change.blade.php
If you want to include beautiful toaster notification add this blade directives below.
<!doctype html> <html> <head> <title>Toastr.js</title> @toastr_css </head> <body> </body> @jquery @toastr_js @toastr_render </html>
Change log
Please see the changelog for more information on what has changed recently.
Todo
Create test
Testing
$ composer test
Contributing
Please see contributing.md for details and a todolist.
Security
If you discover any security related issues, please email author email instead of using the issue tracker.
Credits
License
MIT.