`please` cannot run app commands from app/Console/Commands on Laravel 13.36+

オープン
#15,808 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@lazerg がすでに取り組んでいます。

2026年11月7日 から。

  • #15809 @lazerg による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
laravel, php
領域
backend, cli

調査の方向性

Start by reading src/Console/Please/Kernel.php and compare its getArtisan() command resolution with Laravel 13.36's kernel behavior described in the issue. Check the existing command tests or add a regression case for a command discovered in app/Console/Commands; done means php please app:example works and Statamic commands still run. Pull request #15809 is already open against this issue.

索引モデルが issue の本文から書いたものです。

説明

Bug description

Since Laravel 13.36.0, php please no longer finds commands that Laravel discovers in app/Console/Commands. php artisan runs them normally, but php please fails:

$ php artisan static:warm-links --help     # works
$ php please static:warm-links --help

   ERROR  Command "static:warm-links" is not defined.

The commands are also missing from php please list. Statamic's own commands (php please static:clear and so on) still work.

Cause

laravel/framework#61931 ("Keep the console kernel's own commands on the kernel instance", released in v13.36.0) changed Illuminate\Foundation\Console\Kernel:

  • load() and command() no longer register commands through Artisan::starting(...). They add them to a new property, $kernelCommands.
  • getArtisan() now resolves both lists:
    ->resolveCommands([...$this->kernelCommands, ...$this->commands])
    

Statamic\Console\Please\Kernel::getArtisan() overrides this method and still resolves only $this->commands:

(new Please($this->app, $this->events, Statamic::version()))
    ->resolveCommands($this->commands)

So under please, the commands in $kernelCommands are never registered. Closure commands defined with Artisan::command() in routes/console.php go through Kernel::command() too, so they are probably affected as well (not tested).

Suggested fix

In src/Console/Please/Kernel.php:

->resolveCommands([...($this->kernelCommands ?? []), ...$this->commands])

The ?? [] keeps it working on Laravel versions before 13.36, where the property does not exist. Tested locally: the app command runs under please again, and Statamic's commands still work.

How to reproduce
  1. Statamic 6.x on Laravel 13.36.0 or newer.
  2. php artisan make:command Example (signature e.g. app:example).
  3. php artisan app:example works.
  4. php please app:example fails with Command "app:example" is not defined.
  5. With Laravel 13.35 or older, step 4 works.
Logs
   ERROR  Command "app:example" is not defined.
Environment
Statamic 6.40.0 Pro
Laravel 13.40.0
PHP 8.5.12
Installation

Existing Laravel app, installed Statamic.

Additional details

Found when a deploy script that runs php please <app command> broke after an upgrade that also moved Laravel from 13.29 to 13.40. Workaround: call app commands with php artisan.

主要言語
PHP
スター
4.9k
フォーク
647
平均マージ
21時間 3分
マージ済み PR(30日)
128

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

statamic/cms のほかの issue

statamic/cms の issue をすべて見る

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。