Custom EloquentBuilder based on current user
Hello, I need to display a list of articles based on the currently logged in user. If the user is assigned to a company, I only recover the articles of this one otherwise I recover all the articles. Here is my code:
I always have the list of all the articles displayed regardless of the logged in user
I specify that it uses version v2.17.24 yet I managed to customize my request like that on another project with version v2.16.28. Can you help me please
7 Replies
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Hello @mcfaith, Thank you for your reply.
What does $this->taskWork represent and this code is implemented in which method please?
Did you use some debugging tool to check if the code is run? Did you add it to the resource?
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
hey @Dennis Koch When I put a dd("test") in the getEloquentQuery() method and I refresh the page nothing happens but as soon as I click on a resource, the dd("test") is executed yet my ViewArticle page does not contains only the base code
Yess I add it in my Resource
Sorry for the delai
Can you try
getTableQuery()
on the list page instead?Hey @Dennis Koch, thank you. It's works now