Skip to content

[6.x] Elements service#18660

Open
riasvdv wants to merge 42 commits into6.xfrom
feature/elements-service
Open

[6.x] Elements service#18660
riasvdv wants to merge 42 commits into6.xfrom
feature/elements-service

Conversation

@riasvdv
Copy link
Copy Markdown
Contributor

@riasvdv riasvdv commented Apr 1, 2026

Introduction

Ports the Elements service, extracting one more new "public" service including a Facade:

  • ElementTypes

Other public services that have been extracted before:

Operations

The Elements service itself has been split up as well to be a public service that forwards to the following Operation services:

  • ElementCanonicalChanges
  • ElementDeletions
  • ElementDuplicates
  • ElementEagerLoader
  • ElementPlaceholders
  • ElementRefs
  • ElementUris
  • ElementWrites

These services are marked as @internal - meaning they should only be used within the Element namespace, the Elements service in particular.

There is also no Facade created for any of these services as they really are meant to only be called by the Elements service.

This split allows us to have classes that are maintainable and tests that are separated by the concerns while still having one general service to interact with them.

Authorization

All authorization methods have not been ported over. These are now handled directly by using Laravel's Gate or $user->can() through the ElementPolicy.

The legacy service registers a before callback that fires the legacy authorization events.

Base automatically changed from feature/element-activity to 6.x April 1, 2026 15:38
@riasvdv riasvdv marked this pull request as ready for review April 3, 2026 10:05
@riasvdv riasvdv requested a review from brandonkelly April 3, 2026 10:05
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