Skip to content

Conversation

@ryanmitchell
Copy link
Contributor

@ryanmitchell ryanmitchell commented Dec 10, 2025

This PR allows developers to hook into GetItemsContainingData and add other lazy collections to the response from getItemsContainingData.

This would allow you to provide other items to search for references in, for example when assets references need to be updated.

Our specific use case is that we have Runway models we want assets references to be updated in when they are moved/replaced.

Example usage:

UpdateAssetReferences::hook('additional', function ($payload, $next) {
    return MyModel::query()->lazy();
});

@duncanmcclean
Copy link
Member

Good idea!

@jasonvarga jasonvarga merged commit f3c643b into statamic:5.x Dec 11, 2025
28 checks passed
@ryanmitchell ryanmitchell deleted the feature/asset-reference-updater-hookable branch December 12, 2025 09:49
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.

3 participants