Change Password Functionality with Laravel Authentication
In this article, we will implement the Change password functionality over the basic Authentication that is provided by Laravel.
Before we jump into the implementation make sure you have the following ready.
Note: This tutorial works with Laravel 5.5 as well as the new version of Laravel 8
Alright, let’s dive into the steps.
Change Password Form Page
Let’s first create a change password form page and the required route and controller method for the same.
Add the following entry into your route (routes / web.php) file.
Route Entry
Now let’s add the supporting controller method showChangePasswordForm
in Controller. For demonstration purposes, I am adding my controller method’s in HomeController
. But you are free to put it in any other suitable controller or create a separate controller for the change-password functionality.
Controller Method
Note: Make sure your controller is restricted with auth
middleware. With that, we can make sure that only authenticated users can access the change password functionality. You should have auth middleware in your controller’s constructor.
and now, let’s create our change password view file named changepassword.blade.php
under resources / views / auth .
View File
This is all is required to create your change password form. Now if the user is logged in and if you go to yourdomain.dev/changePassword
then you should see the below page.

Post Change Password Request
Now let’s write our code to process the change password request.
Route entry
Controller Method
In this controller method, We check the following things in order.
- The current password provided by the user should match the password stored in the database. We check this by using
Hash::check
the method. - The current password and the new password should not be the same.
- Validate the new password requirements, the new password, and confirm password should be the same.
Once all of this pass-through, we can go ahead and change the password for the user account and redirect him back with the success message.



If you are looking to include the change Password link in your user tab in the navigation bar. Like this.
Include the following snippet in your layouts / app.blade.php file. Just below the logout link
That’s it! Great Job on Implementing Change Password Functionality on your application.