register() binds services and registers into registries; boot() does work that may depend on other modules. Every module registers before any module boots, which is why widget areas must be registered in register().

A module class has two methods and the order matters:

final class Example extends Module
{
    public function register(): void
    {
        $this->app->singleton('examples', fn () => new Services\Examples(
            $this->app->make('db'),
        ));
    }

    public function boot(): void
    {
        $this->app->make('content_types')->register('example', [...]);
    }
}

Every module's register() runs before any module's boot(). So register() may not assume another module has done anything, and boot() may.

🚨 Widget areas must be registered in register(), not boot(). The widget module wires one listener per area during its own boot; an area registered in boot() is only picked up if your module happens to boot first, which is a bug that appears and disappears with unrelated changes.

Sign in to say whether this helped.