winnie/laravelchangepassword

:Laravel framework change password functionality.

v1.3 2020-10-17 08:04 UTC

This package is auto-updated.

Last update: 2024-11-17 17:14:33 UTC


README

Latest Version on Packagist Total Downloads Build Status StyleCI

Laravel framework change password functionality. I assume you use built-in laravel authentication / laravel ui.

laravelchangepassword

Installation

  1. Require the Package via Composer
$ composer require winnie/laravelchangepassword
  1. 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
    ...
];
  1. 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.