Any way to get record in searchable()
Hi all,
I'm trying to get the record in searchable() for a polymorphic relationship where the searchable model property varies according to the model.
I can get this working to return the correct property value in the formatStateUsing(), but can't find a way to get the record in searchable()
Any ideas?
Regards,
Andy
2 Replies
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
@_andypeacock searchable() is applied to the query. it does not have $record because it does not scope the query for 1 record, its just a query scope
you probably want a whereHasMorph() (i dont know the exact name but it’s similar to that) where you can apply a different searchable scope based on the type of mprph