Sometimes you keep changing your files and you still get error in PHP framework like Laravel. The best way to remove the cache and see the changes in Laravel is by doing the below
1. Change .env file correctly
Make sure you set up your database name, database password and user name correctly in .env file.
The one in the red boxes are must to fill in carefully. For windows user localhost, you might not have database password if you use Xampp server.
2. Remove cache and config
To remove cache and config you must run the following two commands
php artisan cache:clear;
php artisan config:clear;
3. Remove config.php file
Running the above two commands might not be enough. We may also need to remove
app/bootstrap/cache/config.php file. Delete the config.php file. It would be auto generated next time.
4. Run server
To run the server make sure, you run the below command
php artisan serve
5. New browser
Sometimes the cache might not be removed from the browser. So either remove the browser cache or run the application on a new browser. You should be good to go.