Closed joshhornby closed 1 year ago
Hi @joshhornby
I appreciate you taking the time to report the issue with the global search functionality. I cannot reproduce the problem you mentioned. Likewise, I added two different models to the configuration and configured them.
'search' => [
\App\Models\User::class,
\App\Models\Task::class,
],
Then in the browser I tried to do a search with the database driver and got results from both models:
scrnli_19-05-2023_02-39-15.webm
Do you have any idea what I did wrong to reproduce the error?
Thanks for such a quick response @tabuna - also just want to say Orchid is an amazing piece of software.
Let me go back to the drawing board and see what I'm doing wrong - I'll update this ticket shortly.
After running a php artisan optimize:clear
everything started working, which is odd as I never ran php artisan optimize
. Anyway, all working.
Describe the bug When using the global search functionality, only the first model from the
search
array in theplatform.php
config is searched against.Looking in the
SearchScreen
file I believe the issue is with thegetSearchModel
function. This function returns a single model, the first in the collection and then makes a query against only this model.To Reproduce Steps to reproduce the behavior:
search
array of theplatform
config fileExpected behavior When using the global search all models listed the
search
array should be searchable.