Searching specific fields on joined models. #795
billyk18278
started this conversation in
Ideas
Replies: 3 comments 6 replies
-
Hello!, can you create a test repository that has this situation so I can think of a solution for these cases?. In any case, I can include it in version 4 |
Beta Was this translation helpful? Give feedback.
2 replies
-
if you are interested i will try to make i small table in a public url to show you. email me for the temporary link |
Beta Was this translation helpful? Give feedback.
2 replies
-
` public function relationSearch(): array
` |
Beta Was this translation helpful? Give feedback.
2 replies
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.
Uh oh!
There was an error while loading. Please reload this page.
-
⚡ PowerGrid ⚡ Feature Request
Summary
Assuming models are defined properly and datasource is defined using ModelName::query()->with('Submodel1')->with('Submodel2')
and relationSearch() is defined ['submodel1'=>['sm1field1','sm1field2'], 'submodel2'=>['sm2field1','sm2field2']]
I have noticed that full table search works perfectly well.(i.e. searching for a value of sm2field1 works)
but
if i want an input search in the specific column (e.g. ->makeInputText('submodel2.sm2field1') crashes (SQLSTATE[42S22]: Column not found: 1054 Unknown column in 'where clause' )
I know that if datasource is defined differently [https://github.com/Power-Components/powergrid-demo/blob/main/app/Http/Livewire/DishesTable.php] this is solved but there are obvious advantages in the method of my example.
(thanks for the great library anyway)
Beta Was this translation helpful? Give feedback.
All reactions