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
When you add a Tag field to a Lens, you can't sort columns.
[2025-04-18 09:58:49] local.ERROR: Call to undefined method Illuminate\Database\Eloquent\Relations\BelongsToMany::getForeignKey() {"userId":1,"exception":"[object] (BadMethodCallException(code: 0): Call to undefined method Illuminate\\Database\\Eloquent\\Relations\\BelongsToMany::getForeignKey() at /Users/tof/Herd/nova-issue-6806/vendor/laravel/framework/src/Illuminate/Support/Traits/ForwardsCalls.php:67)
According to this #6311 (comment), lens should be used to display flattened data, and BelongsToMany isn't flattened. But, I think that Tag field is the "flattened view" of a belongsToMany. What do you think?
Detailed steps to reproduce the issue on a fresh Nova installation:
Uncomment this code and sort UserLens view with any columns.
Description:
When you add a
Tag
field to a Lens, you can't sort columns.According to this #6311 (comment), lens should be used to display flattened data, and BelongsToMany isn't flattened. But, I think that
Tag
field is the "flattened view" of a belongsToMany. What do you think?Detailed steps to reproduce the issue on a fresh Nova installation:
Uncomment this code and sort UserLens view with any columns.
https://github.com/kichetof/nova-issue-6806/blob/2ea23cd0d1f05b02b3a7d9c3d7efab53eb085982/app/Nova/User.php#L69-L75
The text was updated successfully, but these errors were encountered: