My Laravel 5 has run OK until the database was configured, then found this error:
SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name o
It's possible that your configuration variables are cached. Verify your config/app.php as well as your .env file then try
config/app.php
.env
php artisan cache:clear
on the command line.