`lando artisan` 命令 returns 一个奇怪的错误

`lando artisan` command returns a weird error

如果您曾与 Laravel 和 Lando 一起工作过,您可能知道 Lando 为您提供了自己的 artisan 快捷方式。因此,不必 运行 lando php artisan ...,您可以 运行 lando artisan ....

但是,当我这样做时,出现了这个错误:

Could not open input file: /app/./../artisan

这迫使我必须 运行 lando php artisan 到 运行 任何 artisan 命令,这确实工作正常。到目前为止,这就是我在 Lando 的项目出现的所有问题。其他一切都运行宁顺利。

这是我的 lando 配置:

name: laravel-project
recipe: laravel
config:
  php: '7.4'
  composer_version: '2.0.12'
  database: mysql:8.0
services:
  appserver:
    webroot: public
    xdebug: true
    config:
      php: .vscode/php.ini
  node:
    type: node:14
tooling:
  node:
    service: node
  yarn:
    service: node

此外,这看起来确实与 Lando 的 sample config on their website. This is because I was trying to configure xdebug according to their "Using Lando with VSCode" 说明有点不同(参见 Lando rc.2+ 版本)。

感谢任何解决这个奇怪问题的帮助。它不会使人虚弱,但当我忘记解决方法时它确实会妨碍我。


其他说明:

我成功了。我将 webroot 键移回了顶级 config 下。不确定有什么区别,但只要它有效...我想我真正需要在 appserver 服务中指定的唯一东西是 Xdebug 设置。

name: laravel-project
recipe: laravel
config:
  php: '7.4'
  composer_version: '2.0.12'
  webroot: public
  database: mysql:8.0
services:
  appserver:
    xdebug: true
    config:
      php: .vscode/php.ini
  node:
    type: node:14
tooling:
  node:
    service: node
  yarn:
    service: node