Issue: command fails when i run php artisan schedule:run
I am getting the following error when i run php artisan schedule:run
There are no commands defined in the "xxxxx" namespace. {"exception":"[object] (Symfony\Component\Console\Exception\NamespaceNotFoundException(code: 0):
Both my command and app.php files look okay. I am using withschedule like
i have the signature defined correctly but still getting the error. when i run schedule:run it shows
2026-06-17 16:08:47 Running ["artisan" xxxxx:xxxxx].....DONE
then the log files show the error.
Ok, show command file and path to it. It should be under app/Console/Commands and command class should extend \Illuminate\Console\Command. Or you have to register a closure in routes/console.php.
I did the same on fresh Laravel 12.62 and it works fine:
> php artisan make:command OverdueInvoicePenalty --command=overdue:invoice-penalty
INFO Console command [...\app\Console\Commands\OverdueInvoicePenalty.php] created successfully.
> php artisan list overdue
Available commands for the "overdue" namespace:
overdue:invoice-penalty Command description
just to mention. This wasn't a fresh laravel 12x install but an updrade from 9x. Maybe i missed something but i did go through the docs and made sure i moved everything as needed. Everything else is working just fine apart from this only.