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
Because of the way Orchid\Crud\Arbitrator checks if the model implements the required traits (Filterable), it only finds the trait if the model directly uses it... but not if the model extends a model that has use Filterable;
Three solutions come to mind:
Write a new function like the trait_uses_recursive helper function that also traverse the parent classes.
Stop validating the traits and rely on the developers to understand the Call to undefined method Illuminate\Database\Eloquent\Builder::filters() error they'll get.
Improve the error to state that the trait must be included directly on the Model being used as a resources.
I'm mostly raising this issue so that if someone else runs into the error, they don't spin their wheels for 5 hours like I did. If nothing changes, at least this issue report may come up in their search.
Because of the way Orchid\Crud\Arbitrator checks if the model implements the required traits (Filterable), it only finds the trait if the model directly uses it... but not if the model extends a model that has
use Filterable;
Three solutions come to mind:
trait_uses_recursive
helper function that also traverse the parent classes.Call to undefined method Illuminate\Database\Eloquent\Builder::filters()
error they'll get.I'm mostly raising this issue so that if someone else runs into the error, they don't spin their wheels for 5 hours like I did. If nothing changes, at least this issue report may come up in their search.
In the meantime, I suggest at least a documentation update.
orchidsoftware/orchid.software@8aded35
The text was updated successfully, but these errors were encountered: