You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 2, 2023. It is now read-only.
Package idea: I'd love to be able to sort by computed field. Right now I'm just adding the field as a regular field, and periodically double-checking it (ew :). Anyone have a smarter idea?
The text was updated successfully, but these errors were encountered:
So, there are SOME things you can do, as you can see in that issue above. But one of the authors of Nova, David Hemphill, also said it's going to be tough to do it without breaking pagination--probably because it's using MySQL-based sort and you can't do that with a PHP-computed property.
With your periodically double-checking option, if you get stuck there and no one can solve this particular issue, one option (and maybe this is what you mean with periodical double-check it) is to set a trigger--either a cron job, or every time an event happens that would impact the computation of this field--that then makes Laravel calculate it and save it to the regular computed field. Like a projection.
Not sure where that lines up with your specific use case. Like I mentioned in the previous issue, I hope we can solve this because I've definitely run into it before!
Yep, that's what I mean. It would be nice to have the option to sort via Vue, for the models that's appropriate for. Then it would be doable! I don't have a good sense of how much data js can deal with, but I've done it by hand (not Nova) for projects with the amount of data in my use case, and it's a perfect solution.
You would (as before) define a closure for php on how to render the information and define a database operation which will sort the rows the same like you did with your render function. This string could be simply be used with eloquents orderByRaw operation.
It's the only way it could work and it's a very sane approach.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Package idea: I'd love to be able to sort by computed field. Right now I'm just adding the field as a regular field, and periodically double-checking it (ew :). Anyone have a smarter idea?
The text was updated successfully, but these errors were encountered: