doubt with getEloquentQuery
I have a resource with the following getEloquentQuery:
In the table I see everything correct, but if I enter any of them in view/edit it always shows me the same record in all of them.
Am I missing something?
Thanks
10 Replies
Maybe getTableQuery instead?
Unless you need the same logic to apply.
Ok, I will try, the logic is the same for the table and for the form. I only have problems with the query inside the else. What I find strange is that in the table I see the correct records, but instead when I open the form to view/edit I only see the same for all records
Yea, that’s what’s weird to me. It doesn’t make sense that the scope is being applied to a single record.
I can't solve the problem.
The table is shown with the correct records, but when I open the form it is always the same record.
I don't know what else to do, because the table is displayed correctly...
Example:
If I delete from GetEloquentQuery function this, no problems:
What is vip()?
scope:
There’s your problem. The query will only ever return the logged in user.
Yes, but filter not working.
I have the same problem with this:
When I enter a second condition the filters stop working.
If I leave one of the conditions it works fine.
Can anyone do a quick test to see if it fails as well? Thanks