Replies: 3 comments
-
have you found the answer, i have the same case |
Beta Was this translation helpful? Give feedback.
-
@MrPaolito @ghazanul which version are you using? Tested here with php 8.4, laravel 12, and powergrid 6.4, and had no issues, but I also didn't use relationSearch. In this context, I don't believe you need relationSearch, the reason being you are eager loading all the data needed, so whenever you search for something, it will include almost all the fields that are being displayed by default, so for this case in specific relationSearch is not needed, let me know if you have any further questions. You may also want to take a look at how the powergrid team expects it to be used Relation Search Example |
Beta Was this translation helpful? Give feedback.
-
@Honokai |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone, I am encountering an issue when trying to create a complete table where users can perform a quick search but
when I try to run the "search query" with a
leftJoin
between these tables, I get the following error:Database and Models
Here is a brief description of my database schema and models:
notes
Tableid
,data
,nota
,vehicle_id
,created_at
,updated_at
notes
table stores information related to notes and includes a foreign key reference to thevehicles
table viavehicle_id
.vehicles
Tableid
,targa
,marca
,modello
,anno
,owner_id
vehicles
table contains information about vehicles and includes a foreign key reference to theowners
table viaowner_id
.owners
Tableid
,nome
,cognome
,paese
owners
table contains information about vehicle owners.Relationships:
notes
has a foreign keyvehicle_id
referencing thevehicles
table.vehicles
has a foreign keyowner_id
referencing theowners
table.Code Implementation
datasource
MethodrelationSearch
Methodfields
andcolumns
MethodsIssue
The query results in an error regarding the column
owner.nome
. The error message suggests that the column doesn't exist.I suspect that this is an issue related to how I’m referencing the column in the query. I have checked the database structure, and it seems that the field is correctly named
nome
. However, it might be possible that the issue is how I’m joining referencing the owner relation or the table's settingsAdditionally, I want to highlight that when I run the same query directly in the terminal, it works without any issues and returns the correct results. This suggests that the issue might be specific to how the query is constructed or executed within search powergrid component.
I noticed that the error disappears if I change
owner
toowners
in therelationSearch
array, but of course, it doesn't return any results (Example: If I specifically search for a word that is entered in the 'nome' field)Can you help me understand where the error is hidden? Thank you very much and sorry for any possible typing errors
Beta Was this translation helpful? Give feedback.
All reactions