#table actions not working

36 messages · Page 1 of 1 (latest)

tidal glen
#

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.

tidal glen
#

i even tried adding require confirmation to show modal, or dd/log to troubleshoot, still nothing happens

river oasis
#

What version of filamentphp are you using?

tidal glen
#

"filament/filament": "^3.2",

river oasis
#

Actual Version.

tidal glen
#

should be v3.2.122

#

whats frustating is this works yesterday, pushed the code, and when i try again today it just suddently doesnt work @@

river oasis
#

Does it work locally?

#

Code looks good from here though

#

Maybe move your visible below action

tidal glen
#

yes yesterday. what i meant with push is just push to repo. today when i try again it just suddenly doesnt work

tidal glen
river oasis
#

Try going back a few versions

to ensure it's not due to an update

#

Also, I would ensure you have cleared cache

tidal glen
#

thanks for ur inputs, will try again tmrw

tidal glen
#

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.

#

@@

river oasis
#

Sounds like you need to debug the approval process.

tidal glen
#

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);
            // })

i commented out this and everything works fine

river oasis
#

There you go then... so why are you using query?

tidal glen
#

to only display document belongs to my department

river oasis
#

So why not scope the model?

tidal glen
#

and

#

yeah you're right. ill try it out

river oasis
tidal glen
#

whats the use case for query?

river oasis
#

Query to if Im recall to overwrite the entire query with a custom query. whereas modify query, adds to it.