Skip to content

refactor: keep roles free of Laravel before they become a package - #489

Merged
ogorzalka merged 1 commit into
release/v13.36.1from
refactor/roles-ports
Oct 15, 2026
Merged

ogorzalka merged 1 commit into
release/v13.36.1from
refactor/roles-ports

Conversation

@ogorzalka

Copy link
Copy Markdown
Member

Step 1 of the extraction of pollora/roles (plan: .claude/plans/meta-roles-bindings-packages.md in pollora-test).

  • RoleDefinitionBuilder: the label of a #[Role] without one comes from Naming::headline() (pollora/attributes 0.1.1, same words as Str::headline(), checked against it) and Naming::classBasename() instead of class_basename().
  • What needs Laravel moves to Pollora\Role\Infrastructure\Laravel: provider, EnsureUserHasRole, RoleDirective, RolesCheck, the six commands and their stubs. They stay in the framework when the package is extracted.
  • pollora/attributes is required at ^0.1.1 || ^1.0.
  • surface.json: the diff is the moved classes only.

Checked: Roles unit and contract tests, PHPStan, Rector, Pint; the 28 captures of pollora-test (roles:list, roles:show ×6, doctor, wp_user_roles, pages, REST, bindings…) are identical to the references taken before the change.

The label of a #[Role] without one comes from Naming::headline(), and what needs Laravel
(provider, middleware, @ROLE directive, doctor check, commands and stubs) moves to
Pollora\Role\Infrastructure\Laravel. Roles, capabilities and command outputs of
pollora-test are identical to the references taken before.
@ogorzalka
ogorzalka merged commit 9f24f92 into release/v13.36.1 Oct 15, 2026
10 checks passed
@ogorzalka
ogorzalka deleted the refactor/roles-ports branch October 15, 2026 13:54
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