Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[6.x] Refactor augmentation #354

Merged
merged 15 commits into from
Nov 4, 2023
Merged

[6.x] Refactor augmentation #354

merged 15 commits into from
Nov 4, 2023

Conversation

duncanmcclean
Copy link
Member

@duncanmcclean duncanmcclean commented Oct 25, 2023

This pull request refactors how augmentation works in Runway to bring it inline with how Statamic Core does augmentation.

Breaking changes

If you have any custom code that calls any of Runway's augmentation methods, you'll need to refactor them. Here's a few examples:

// Previously....
$resource->augment($model);
AugmentedModel::augment($model, $resource->blueprint());

// Now..
$model->toAugmentedArray();

The output of ->toAugmentedArray() will likely be slightly different to what was returned previously. Each of the items in the array will be a Value object.

You should test your code and make any necessary adjustments.

To Do

  • Write a better PR description
  • Ensure nested fields get augmented correctly

@duncanmcclean duncanmcclean marked this pull request as ready for review November 4, 2023 14:51
@duncanmcclean duncanmcclean merged commit a03947c into 6.x Nov 4, 2023
@duncanmcclean duncanmcclean deleted the refactor/augmentation branch November 4, 2023 14:56
Copy link

Released as part of v6.0.0.

1 similar comment
Copy link

Released as part of v6.0.0.

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