I had the same problem... If you have set your DB name and username and pass correctly in .env file and its still not working run the blow code in terminal:(this will clean the caches that left from previous apps)
php artisan cache:clear
and then run the command php artisan serve
again (if you are running it stop and run it again)