Skip to content
Discussion options

You must be logged in to vote

I can't remember if I've tested it on relationships, but, I'm showing 'nested properties' using dot-notation.
Basically, say, my user has a JSON column of values, or I'm using casts to build a property that is an array, then I can refer to one of the nested properties using dot-notation.

For your use-case, maybe dot-notation works on referencing relationships as well?

Text::make(__('Primary Street Address'), attribute: 'addresses.primary.street')

Other than that, what comes to mind directly is computed fields.

Text::make(__('Primary Street Address'), function (User $user): string {
    // Replace with what makes sense. I'm assuming your 'addresses' aren't keyed like this,
    //   but for…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@robbedekien
Comment options

Answer selected by haztakki
Comment options

You must be logged in to vote
1 reply
@juse-less
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants