Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Console commands aren't loaded #47327 #47377

Closed
makroxyz opened this issue Jun 8, 2023 · 4 comments
Closed

Console commands aren't loaded #47327 #47377

makroxyz opened this issue Jun 8, 2023 · 4 comments
Labels

Comments

@makroxyz
Copy link

makroxyz commented Jun 8, 2023

Laravel Version

10.13.2

PHP Version

8.1.17

Database Driver & Version

No response

Description

after update to laravel 10.13.2 my console commands are not loaded

Steps To Reproduce

my composer.json

"autoload": {
        "psr-4": {
            "App\\": "app/App/",
            "Domain\\": "app/Domain/",
           .....

due to PR #47327 now Kernel load is trying to load App\App\Console\Commands\MyCommand.php that is a wrong namespace

MyCommand.php file is in app/App/Console/Commands folder and in the App\Console\Commands namespace

@kristoffermodified
Copy link

Same issue here on the latest version

@calebdw
Copy link
Contributor

calebdw commented Jun 9, 2023

@makroxyz,

What does your ->load() call look like in Kernel::commands()?

The best path forward is to probably use the composer autoload classmap to get the class from the filename instead of trying to make assumptions when parsing the filename---I can PR a fix

@makroxyz
Copy link
Author

makroxyz commented Jun 9, 2023

@makroxyz,

What does your ->load() call look like in Kernel::commands()?

It is not modified, default one

The best path forward is to probably use the composer autoload classmap to get the class from the filename instead of trying to make assumptions when parsing the filename---I can PR a fix

I think it's the best way to fix. Thanks

@driesvints
Copy link
Member

We reverted the original PR for now. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants