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

Feature/inherit from relation #4

Merged
merged 13 commits into from
Dec 18, 2023
Merged

Feature/inherit from relation #4

merged 13 commits into from
Dec 18, 2023

Conversation

luttje
Copy link
Owner

@luttje luttje commented Dec 18, 2023

Allow inheritance of other fields in (related) models.

Example situation

  • Organization model has an attribute default_discount. It can be edited in the resource OrganizationResource.
  • Product model has a relation to organization through (organization). It can be edited in the resource ProductResource

A user configures a user attribute discount on ProductResource to inherit from default_discount from Organization.

Current limitations

Using the above situation as an example of the current limitations

  • The field to inherit from must have a user visible Field in Organization Resource
  • This only works in Resource derived Resources (not in Livewire components)
  • This currently only works if the ProductResource has a field organization_id that contains the id of the related Organization

@luttje luttje added the enhancement New feature or request label Dec 18, 2023
@luttje luttje self-assigned this Dec 18, 2023
@luttje luttje marked this pull request as ready for review December 18, 2023 19:31
@luttje luttje merged commit 947ae6d into main Dec 18, 2023
5 checks passed
@luttje luttje deleted the feature/inherit-from-relation branch December 18, 2023 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant