Read some good reviews on laravel tinker, a phpstorm plugin which I wanted to try out. I installed the plugin on my phpstorm editor and was ready to start tinkering. Was using Laradock which I had configuration for apache2, mysql, workspace and phpmyadmin. All was running well until I decided to experiment with laravel tinker.
Laravel tinker could not resolve the host name -
Illuminate\Database\QueryException with message 'SQLSTATE[HY000]  php_network_getaddresses: getaddrinfo failed: No address associated with hostname.
After long hours of reading and searching online for a solution I couldn't get the help I needed. I later had suggestion from a senior colleague to use the IP adrress of mysql docker container. I did try and this time around the error changed to
Illuminate\Database\QueryException with message 'SQLSTATE[HY000]  Connection timed out
Making progress at least. I then inspected the mysql docker container networks by using the command :
docker inspect [container id]
Had a long list of information on the container but the focus was on the Networks properties of the NetworkSettings.
Hope this article helps someone who might find him or herself in similar situation. Comments and corrections are welcome as we all learn by building each other up.