![]() If you are still not installed Laravel in your machine you can configure it from here. To Continue with this tutorial, you should have installed Laravel 8 in your pc. When you need to change your password with submit your current password, this will be the easiest way to do it. In this tutorial, we are going to learn how to implement Change password functionality in Laravel. You can obtain complete source code and asset files for this tutorial from this GitHub repository. If you have any issue regarding this tutorial, mention your issue in comment section or reach me through my E-mail. In this tutorial, we implemented password change functionality in Laravel. Now we can run your application using below command: Now we have already finished our application. Route::post('change-password', ' ')->name('change.password') Now you need to add below two routes for showing the view and posting password change request. 'password'=> Hash::make($request->new_password) Php artisan make:controller ChangePasswordController You can create your controller using following command: First function for showing our change password view and second for change password functionality. Now we need to create need to implement two functions within our controller. Return 'The :attribute should match with old password.' You can create this custom rule by running:Īfter creating our custom rule, now you need to paste below code in it: Now we need to create a custom validation rule to validate our old password. Then navigate to your project directory by using below command in your terminalĪfter creating our project, now you can set up default Laravel auth and run database migration. If you are still not installed Laravel in your machine you can configure it from here.įirst you need to create a new laravel project by running below command in your terminalĬomposer create-project laravel/laravel laravel-change-password
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |