`please` cannot run app commands from app/Console/Commands on Laravel 13.36+
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 35/100
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()andcommand()no longer register commands throughArtisan::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
- Statamic 6.x on Laravel 13.36.0 or newer.
php artisan make:command Example(signature e.g.app:example).php artisan app:exampleworks.php please app:examplefails withCommand "app:example" is not defined.- 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
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de statamic/cms
-
Passing `null` to `bool_string` modifier returns nothing instead of `false`Posiblemente ocupada @shadetheory la tomó hace 4 días. Abiertomodifiers
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
statamic/cms#15748 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
accessibility
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Los mantenedores suelen responder en 1 día
-
antlers
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
Los mantenedores suelen responder en 1 día
-
`GlobalRuntimeState::$interpolatedVariables` is never reset, so long-running Antlers renders slow down without boundPosiblemente ocupada @lazerg la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 35/100
Los mantenedores suelen responder en 1 día
-
Command palette doesn’t index non published itemsPosiblemente ocupada @lazerg la tomó hace 1 día. Abiertosearch
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
Los mantenedores suelen responder en 1 día
Todos los issues de statamic/cms
Issues similares
-
Captured slideshow pass overwrites the route path, aborting compose with a rebind() TypeErrorAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Automattic/blocks-engine#5003 ·
Los mantenedores suelen responder en 1 día
-
from-cloud mythic tracked
Dificultad 1/5 Menos de una hora Aptitud para principiantes 86/100
MythicalLTD/FeatherPanel#459 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
[Bug]: PostgreSQL backend: Queue.remove() / Job.remove() never emit the QueueEvents "removed" eventPosiblemente ocupada @1AbdullahButt la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
taskforcesh/bullmq#5085 ·
Los mantenedores suelen responder en 1 día
-
area:mesi area:php-extension good first issue priority:low type:chore
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
crazy-goat/go-mesi#652 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
shukiv/jabali-panel#2423 ·
Los mantenedores suelen responder en 1 día