Laravel Sail

Add PhpMyAdmin into laravel sail container

Introduction

Laravel Sail is a light-weight command-line interface for interacting with Laravel's default Docker development environment. Sail provides a great starting point for building a Laravel application using PHP, MySQL, and Redis without requiring prior Docker experience.

In this topic, we will talk about PhpMyAdmin Fan. While releasing laravel sail, PHPMyAdmin is not recommended in laravel sail. Some developers are not switched to TablePlus. So, you can add PHPMyAdmin into the laravel sail container. It's not Big Deal!. P.S - DRY.

1. Find Docker Compose

In your project root, find and open up docker-compose.yml and within the services block add the PHPMyAdmin service:

phpmyadmin:
    image: phpmyadmin/phpmyadmin
    links:
        - mysql:mysql
    ports:
        - 8080:80
    environment:
        MYSQL_USERNAME: "${DB_USERNAME}"
        MYSQL_ROOT_PASSWORD: "${DB_PASSWORD}"
        PMA_HOST: mysql
    networks:
        - sail

2. Sail it up

Now go back to the command line and bring back up your Sail container with: ./vendor/bin/sail up

3. Localhost

In your browser, navigate to localhost:8080 and PHPMyAdmin should load.

That's all! Hope it's worked. Enjoy your laravel sail.

Learn More

Last updated