lando icon indicating copy to clipboard operation
lando copied to clipboard

`lando composer require abc/def` installs to wrong folder, if webroot is set to a folder and not .

Open lukastom opened this issue 1 year ago • 2 comments

How to reproduce:

  1. in .lando.yml, set webroot to a folder, e.g. webroot: blog/public (let us say, we have a path /home/user/Sites/Laravel-Blog/blog/ in which is our Laravel installation)
  2. go to your folder, where you run "lando start", e.g. /home/user/Sites/Laravel-Blog
  3. start lando, run lando composer require abc/def
  4. the composer packages are not installed in the webroot folder ("/blog") but in the folder "Laravel-Blog". If I am not mistaken, lando composer should respect the webroot path. The workaround is to do lando ssh, cd in the roght path and run composer there.

lukastom avatar May 27 '23 15:05 lukastom

Running any lando command will do so in the current folder except lando start / stop, which will traverse down to find a .lando.yml. CD into the correct path and then run lando composer require abc/def just as you would if you run it with PHP directly

FredrikMBP avatar May 30 '23 05:05 FredrikMBP

Thank you! I didn't realize there is no need to ssh into but I can just cd there!

lukastom avatar May 30 '23 06:05 lukastom