Unable to get PhpMyAdmin with MariaDb docker-compose

Being new to Docker for the purpose of practicing I have created docker-compose.yml file on my local environment but I am having issue with PhpMyAdmin it comes up with a wierd error

mysqli_real_connect(): php_network_getaddresses: getaddrinfo failed:
Name or service not known

As far Ive searched for it I have come to know that its due to that PhpMyAdmin is unable to find the server. But unable to fix it.

version: '3'
services:
  myapp:
    image: 'bitnami/codeigniter:3'
    ports:
      - '8000:8000'
    volumes:
      - '.:/app'
    depends_on:
      - mariadb
  mariadb:
    image: 'bitnami/mariadb:10.3'
    environment:
      - ALLOW_EMPTY_PASSWORD=yes
  phpmyadmin:
      image: phpmyadmin/phpmyadmin
      container_name: phpmyadmin
      restart: always
      ports:
          - 8080:80
      volumes:
          - /sessions
      links:
          - mariadb

Source: StackOverflow