Dockerized Laravel SQLSTATE[HY000] [2002] Connection refused

  docker, laradock, laravel, linux, mysql

I’ve set up a Laravel project with laradock and docker tried to run it and it gave me SQLSTATE[HY000] [2002] Connection refused error. Here is some of my config files;

  1. Laradock .env :
  2. Laravel .env :
  3. App.php :

I’ve looked at this post but didn’t helped me. I run Ubuntu 20.04 and i work with Docker. I tried them just in case but didn’t worked out for me. Any help is appreciated.

Source: Docker Questions