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

Allow dot notation for customer attributes #38

Merged
merged 2 commits into from
Aug 10, 2020

Conversation

izzyp
Copy link
Contributor

@izzyp izzyp commented Aug 6, 2020

I'd like to propose allowing the use of dot notation for accessing nested attributes via relationships when using custom attributes.

Eg: For a table of posts, instead of adding an accessor attribute to the Post model getAuthorFullNameAttribute(), using dot notation, you can simply access the authors full_name attribute directly, through the relationship:

Column::make(__('Author'), 'author.full_name')
                ->customAttribute()
                ->searchable()
                ->sortable(),

The data_get() helper method will be available even outside of Laravel since Livewire already requires illuminate/support.

Thanks for this awesome package. Truly is a pleasure.

izzyp added 2 commits August 6, 2020 20:10
I'd like to propose allowing the use of dot notation for accessing nested attributes via relationships when using custom attributes.

Eg: For a table of posts, instead of adding an accessor attribute to the Post model `getAuthorFullNameAttribute()`, using dot notation, you can simply access the authors full_name attribute directly, through the relationship:

```
Column::make(__('Author'), 'author.full_name')
                ->customAttribute()
                ->searchable()
                ->sortable(),
```

Thanks for this awesome package. Truly is a pleasure.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Next Release Currently merged into development awaiting a release to master
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants