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

name from presenter class for select field #2863

Closed
wants to merge 3 commits into from
Closed

name from presenter class for select field #2863

wants to merge 3 commits into from

Conversation

pLavrenov
Copy link

Fixes # RelationController.php

@tabuna
Copy link
Member

tabuna commented Jul 23, 2024

Could you add a test?
It seems that this change makes having a Presentor mandatory for the model.

@pLavrenov
Copy link
Author

pLavrenov commented Jul 23, 2024

Yes, my mistake, need only check for the presence of the field.

Added a change to the code and now you can set the name via getAttribute() in Model

For example:

`
public function presenter(): CustomerPresenter
{
return new CustomerPresenter($this);
}

public function getFullNameAttribute(): string
{
return $this->presenter()->fullName();
}
`

@pLavrenov pLavrenov closed this by deleting the head repository Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants