Skip to content

Breaking feature about command and Exception #50500

@jyxjjj

Description

@jyxjjj

Laravel Version

11.0.3

PHP Version

8.3.2

Database Driver & Version

No response

Description

In upgrading from 10.x to 11.x:

However, we do not recommend that Laravel 10 applications upgrading to Laravel 11 attempt to migrate their application structure, as Laravel 11 has been carefully tuned to also support the Laravel 10 application structure.

I don't know if it is on purpose or accidentally.

Steps To Reproduce

(new ApplicationBuilder(new Application(dirname(__DIR__))))
    ->withKernels()
    ->withEvents()
    ->withCommands()
    ->withProviders()
    ->withRouting(fn() => defineRoutes())
    ->withExceptions()
    ->create()

In withCommands, without singleton.
In withExceptions, with singleton.
app/Console/Kernel.php will not be loaded:

    protected function schedule(Schedule $schedule): void
    {
        dump('schedule');

then run php artisan schedule:list:

INFO  No scheduled tasks have been defined.  

without "schedule" //xxx.php:xxx.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions