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

Abierto
#15,808 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@lazerg ya está trabajando en esto.

Desde el 7/11/2026.

  • #15809 de @lazerg — abierto

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Estancado
Stack tecnológico
laravel, php
Área
backend, cli

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
PHP
Estrellas
4.9k
Forks
647
Merge medio
21 h 3 min
PR fusionados (30 d)
128

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de statamic/cms

Todos los issues de statamic/cms

Issues similares

Más issues de PHP

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.