How to: get index from collection using $media model instance #2305
Unanswered
BinaryKitten
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
We're trying to get the index of a particular item in a collection.
We've got the media collection and then filtered that to create a new collection instance and want to get the index of the item from the base collection.
Unfortunately, since Spatie\MediaLibrary\MediaCollections\Models\Media has __invoke passing it to the collection ->search results in a fatal error..
How do we perform the system to get the index, since we can't call a
->search
Beta Was this translation helpful? Give feedback.
All reactions