https://github.com/monim67/laravel-password-update
Laravel user password change/update with password-update event.
https://github.com/monim67/laravel-password-update
laravel laravel-password
Last synced: about 2 months ago
JSON representation
Laravel user password change/update with password-update event.
- Host: GitHub
- URL: https://github.com/monim67/laravel-password-update
- Owner: monim67
- License: mit
- Created: 2018-11-17T20:42:54.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-11-17T21:03:03.000Z (over 6 years ago)
- Last Synced: 2025-04-02T18:11:12.663Z (2 months ago)
- Topics: laravel, laravel-password
- Language: HTML
- Size: 21.5 KB
- Stars: 4
- Watchers: 2
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# laravel-password-update
This package adds password update feature with password-update event to a fresh laravel
installation with default laravel auth. A password controller is included to handle
password update which emits an event after a successful password change. It also includes
password-update forms in Bootstrap 3 and Bootstrap 4 layouts which can be added to any
laravel project with just a single line of code.## Getting Started
Install the package via composer.
composer require monim67/laravel-password-update
Add the following to your routes in `web.php` file.
```php
Route::prefix('password')->group(function(){LaravelPasswordUpdate::routes();});
```This will add 2 routes for password edit and update. You can use any prefix of your choice.
![Routes added by laravel-password-update][routes-image]
If you just want the update route, use the following instead.
```php
Route::prefix('password')->group(function(){LaravelPasswordUpdate::update_routes_only();});
```The edit route will look for `resources\views\auth\passwords\edit.blade.php`.
So create a file extending your base layout template and include the password-update
form in it.```html
@extends('layouts.main')@section('content')
Change Password
@include('laravel-password-update::bootstrap3.horizontal-form')
@stop
```That is all you need, the controller is shipped with the package, you don't need to
write controller actions. Run the development server and visit
`http://localhost:8000/password/edit` to see it in action.## Other Form Layouts
This package includes horizontal and vertical forms for Bootstrap 3 and Bootstrap 4.
You can use any of the following options. You can even use your own markup instead.@include('laravel-password-update::bootstrap3.horizontal-form')
@include('laravel-password-update::bootstrap3.vertical-form')@include('laravel-password-update::bootstrap4.horizontal-form')
@include('laravel-password-update::bootstrap4.vertical-form')If you don't want a separate page to update password, you can add this form in one of
the existing pages ie the profile page or account settings page. Then include only update
route to your `web.php` and include the password-update form in the page of your choice.## Password Update Event
When user updated the password `Monim67\LaravelPasswordUpdate\Events\PasswordUpdate` event
is emitted, you can subscribe to the event or add listeners to it, if you want to send e-mail
notifications to the user when their password updates.[routes-image]: https://raw.githubusercontent.com/monim67/laravel-password-update/d770a82e22d5d3fb464e6ce2ed56496ff7457655/.github/images/routes.png