table actions not working

it worked yesterday. but not today, and i cant figure out why. i tried dd() inside the action but still nothing shows up. on my table row, there are 2 actions - approve and reject. both actions are just simply updating $record.
No description
22 Replies
black ka1ser
black ka1serOP2mo ago
i even tried adding require confirmation to show modal, or dd/log to troubleshoot, still nothing happens
black ka1ser
black ka1serOP2mo ago
No description
toeknee
toeknee2mo ago
What version of filamentphp are you using?
black ka1ser
black ka1serOP2mo ago
"filament/filament": "^3.2",
toeknee
toeknee2mo ago
Actual Version.
black ka1ser
black ka1serOP2mo ago
should be v3.2.122
black ka1ser
black ka1serOP2mo ago
No description
black ka1ser
black ka1serOP2mo ago
whats frustating is this works yesterday, pushed the code, and when i try again today it just suddently doesnt work @@
toeknee
toeknee2mo ago
Does it work locally? Code looks good from here though Maybe move your visible below action
black ka1ser
black ka1serOP2mo ago
yes yesterday. what i meant with push is just push to repo. today when i try again it just suddenly doesnt work still same
toeknee
toeknee2mo ago
Try going back a few versions to ensure it's not due to an update Also, I would ensure you have cleared cache
black ka1ser
black ka1serOP4w ago
ill try this tmrw. as for cache, yes did cleared thanks for ur inputs, will try again tmrw i have noticed something. my friend also cloned the repo and tested this out. we can approve/reject the first document but not the 2nd still, not sure why i have also identified another thing: no matter which document i approve, the first row will be approved. @@
toeknee
toeknee4w ago
Sounds like you need to debug the approval process.
black ka1ser
black ka1serOP4w ago
everything is here, idek what to debug anymore hahaha lemme downgrade it found it
// ->query(function () {
// $user = auth()->user();

// return AccessRequest::query()
// ->whereHas('document', function ($query) use ($user) {
// $query->where('department_id', $user->department_id);
// })
// ->orWhere('user_id', $user->id);
// })
// ->query(function () {
// $user = auth()->user();

// return AccessRequest::query()
// ->whereHas('document', function ($query) use ($user) {
// $query->where('department_id', $user->department_id);
// })
// ->orWhere('user_id', $user->id);
// })
i commented out this and everything works fine
toeknee
toeknee4w ago
There you go then... so why are you using query?
black ka1ser
black ka1serOP4w ago
to only display document belongs to my department
toeknee
toeknee4w ago
So why not scope the model?
black ka1ser
black ka1serOP4w ago
and yeah you're right. ill try it out
toeknee
toeknee4w ago
You don't need too, but you shouldn't use query unless absolutely needed. You can do what you were doing with: https://filamentphp.com/docs/3.x/panels/resources/listing-records#customizing-the-table-eloquent-query
black ka1ser
black ka1serOP4w ago
yaya this is what i remembered before, i thought query() is something new for tables whats the use case for query?
toeknee
toeknee4w ago
Query to if Im recall to overwrite the entire query with a custom query. whereas modify query, adds to it.
black ka1ser
black ka1serOP4w ago
ahhh okay. anyway, thanks for your help. appreciate it
Want results from more Discord servers?
Add your server