Skip to content

[6.x] Update plugin lifecycle#19263

Open
riasvdv wants to merge 3 commits into
6.xfrom
feature/plugins
Open

[6.x] Update plugin lifecycle#19263
riasvdv wants to merge 3 commits into
6.xfrom
feature/plugins

Conversation

@riasvdv

@riasvdv riasvdv commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Description

Moves plugin lifecycle ownership from Laravel package discovery to the Plugins service.

A few key changes:

  • Plugins can now use normal register and boot methods like any normal Laravel service provider.
  • Plugins should no longer add the class to composer.json's extra.laravel.providers key and only in extra.class (Craft plugin convention) since we own when the plugin service provider gets registered and booted. We guard against this with a self-explanatory exception. Any additional service providers that need to run outside the enabled/installed detection can still be added there.
  • The automatic trait registration system has been removed for a fixed method which calls the trait methods at the right time. Much simpler to understand and doesn't cause any unexpected side-effects.
  • Publishes plugin's assets when we publish Craft's assets with craft:setup:publish

Important

This is breaking for any plugins that are currently targeting 6.x, but this is alpha so should not be unexpected.

Upgrade guide:

  • Rename registerPlugin to register in your plugin class
  • Rename bootPlugin to boot in your plugin class
  • Remove the plugin class from extra.laravel.providers in composer.json

@github-actions

github-actions Bot commented Jul 18, 2026

Copy link
Copy Markdown

📚 Storybook previews

@craftcms/cpopen Storybook

No changed components detected in this Storybook.

resources/jsopen Storybook

No changed components detected in this Storybook.

@riasvdv
riasvdv marked this pull request as ready for review July 18, 2026 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant