Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

PlasticHeart's avatar

Why is the .php file of a migration not shown?

I am making a dockerized application with Laravel 7, when doing a migration in the CLI the .php file is created and I can see it in the CLI but in the folder where my project is located that file is not shown, so I can not see in Visual Studio Code to be able to work with it, what can I do to show that file?

0 likes
9 replies
SilenceBringer's avatar

@plasticheart I'm not using Visual Studio Code, but in PhpStorm you can do right click on the directory in project structure and do "Reload from Disk" (force reloading files/folders). I think Visual studio should have something similar to force update

Sinnbeck's avatar

You can copy it over. But it should automatically be synced if you set up volumes correctly

docker cp <containerId>:/file/path/within/container /host/path/target 
1 like
PlasticHeart's avatar

@Sinnbeck From docker-compose.yml I have this:

proyect:
    build:
      context: ./
    image: proyect:latest
    volumes:
      - ./app:/var/www/html/app
      - ./public:/var/www/html/public
      - ./routes:/var/www/html/routes
      - ./resources:/var/www/html/resources
    depends_on:
      - postgres-db
    networks:
      - proyect-net
    ports:
      - "5000:5000"
    environment:
      DATABASE_URL: postgres://database:FFFFFFF@postgres-db:5432/user
Sinnbeck's avatar

The issue here you aren't mapping your database migrations with volumes. Only app, public and routes

1 like

Please or to participate in this conversation.