MYHOSPITALNOW.COM

Find Trusted Doctors & Hospitals

Discover healthcare providers, compare hospitals, and explore treatment options worldwide.

Free Treatment Quotes • Doctor Search • Hospital Comparison

Find Healthcare Options

www.myhospitalnow.com

How to Generate New Password in Laravel?

How to Generate New Password in Laravel?

Step 1. Create a new Project in Laravel, so Open git Bash. Write down the following command:-

$ composer create-project --prefer-dist laravel/laravel changepassword "5.8.*"Code language: JavaScript (javascript)
Git Bash running composer create-project laravel/laravel changepassword 5.8.* in xampp htdocs

Step 2. Now, Move to project directory on git Bash, so write down the following command:-

$ cd changepassword
Git Bash showing cd changepassword moving into the new Laravel project directory

Mysql Database connection Laravel

Step 3. Now, we have to Create a new Database. Go to XAMPP server->phpMyAdmin->Click New Database->changepassword.

PhpMyAdmin Create database form with changepassword entered as the new database name

Step 4. Now, Go to .env file to set the project path and give the project APP_URL, DB_DATABASE name and DB_USERNAME name.

Laravel .env file in Sublime Text with APP_URL set to localhost/changepassword/public highlighted
Laravel .env file with DB_DATABASE=changepassword and DB_USERNAME=root highlighted

Step 5.  Create the user authentication scaffolding. Write down the following command:-

$ php artisan make:auth
Git Bash running php artisan make:auth in the changepassword project

Step 6.  Thereafter, Migrate tables into the MySQL database. Write the following command within git Base.

$ php artisan migrate
Git Bash running php artisan migrate to create tables in the MySQL database

Step 7. Go to app/Http/Controller/HomeController.php file and write down this following code:-

Step 8. Go to resources/views/home.blade.php file and write down this following code:-

Step 9. Go to Route/web.php file and write down this following code:-

Route::post('/home', 'HomeController@changePasswordUpdate')->name('home');
Code language: PHP (php)
Routes/web.php in Sublime Text with POST /home route to HomeController@changePasswordUpdate highlighted

Login

Laravel login form with email and password filled in
Laravel dashboard form with Current, New and Confirm Password fields and Generate New Password button

Checking the current password matches or not with the provided password

Laravel error alert: Your current password does not match what you provided

Checking new password should not be same with the current password

Laravel error alert: Your new password cant be same with your current password

Password changed Successfully

Laravel success alert: Password changed Successfully on the dashboard form

Thanks

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services — all in one place.

Explore Hospitals
With MotoShare.in, you can book a bike instantly, enjoy doorstep delivery, and ride without worries. Perfect for travelers, professionals, and adventure enthusiasts looking for a seamless mobility solution.

Related Posts

How to display a table in a Verticle or Horizontal form in the Laravel PHP Framework? Part-1

How to display a table in a Verticle or Horizontal form in the Laravel PHP Framework? How to Store Seed file into Database. Click There are two…

Read More

HOW TO CREATE EVENT CALENDAR IN LARAVEL? PART-3

Step 1.Create a Database in phpMyAdmin. (Write the same name of database which was written in .enf databse name). Step 2.  We use the migrate command to…

Read More

HOW TO CREATE EVENT CALENDAR IN LARAVEL? PART-2

Step 1.Create a Laravel Project Firstly, Create a new project in laravel, so we open Git Bash,  Go to My Computer/This PC–>LocalDisk(C:)–>Xampp–>Htdocs (Press right click on Mouse)…

Read More

How to file upload in DB With local folder using laravel 5.8

Step:1 you have to make these(A) – php artisan make:controller ImageUploadController(B) – php artisan make:model ImageUpload -m Step:2 Open the welcome.blade.php page then write this code. Step:3…

Read More

How to Store Countries, States, Cities seed classes into the Database in Laravel PHP? (Part-3)

How to Store Countries, States, Cities seed classes into the Database in Laravel PHP Part-1 Part- 2 Step 1. Create a City seeder file. Write down the…

Read More

How to Store Countries, States, Cities seed classes into the Database in Laravel PHP? (Part-1)

How to Store Countries, States, Cities seed classes into the Database in Laravel PHP? Part- 2 Part- 3 Step 1. Create a Country seeder file. Write down…

Read More