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

How to display a calculated value as stars #2

Closed
phuclh opened this issue Jul 16, 2019 · 2 comments
Closed

How to display a calculated value as stars #2

phuclh opened this issue Jul 16, 2019 · 2 comments

Comments

@phuclh
Copy link

phuclh commented Jul 16, 2019

I need to display a star rating with an average rating, then I try to pass that average value into resolvingUsing or displayUsing function but it didn't work.

Rating::make('Rating')->resolveUsing(function ($name) {
                return $this->articles->avg('rating');
            })

How can I display a calculated value as stars (that data isn't a column in the table)

@phuclh
Copy link
Author

phuclh commented Jul 18, 2019

@nbourguig do you have any ideas for that? Thank you.

@nbourguig
Copy link
Contributor

Maybe related to #1, fixed in v1.0.2

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

No branches or pull requests

2 participants