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
Does anyone know how to include custom attributes from the index into the model when returning search results?
I've added custom fields in the index using toSearchableArray and these are showing up when returning the raw results. However, when I use the ->get(), the custom fields are not included in the model objects (as they are not in the underlying database table), and I can't seem to find out how to include them.
The text was updated successfully, but these errors were encountered:
For future reference for others looking into this, I've followed the approach outlined here #28 (comment) and added an additional function that's called in the getIterator() function:
Does anyone know how to include custom attributes from the index into the model when returning search results?
I've added custom fields in the index using
toSearchableArray
and these are showing up when returning the raw results. However, when I use the->get()
, the custom fields are not included in the model objects (as they are not in the underlying database table), and I can't seem to find out how to include them.The text was updated successfully, but these errors were encountered: