ModelTableSelect not filtering by visibility
I'm using
ModalTableSelect
to choose a media item, and I want to show only those with visibility = Opengraph
. However, all media items are showing.
Despite the modifyQueryUsing
filter, it's still listing all media. Is there something I'm missing?6 Replies
the table configuration class needs to have a modifyQueryUsing() scope on it too
Adding
->modifyQueryUsing(fn (Builder $query) => $query->where('visibility', VisibilityType::Opengraph))
in MediaTable.php
works. However, I want to extend MediaTable.php
in OpengraphMediaTable.php
:
But the effect isn't being applied. How can I resolve this?that function doesnt exist like that, did ai generate it?
its $table->modifyQueryUsing() only
I added this one, and it's working
Claude, yes
read the docs instead 🤣
Sure, will do; else I would end up with like this one