cybercog / laravel-nova-ban

Laravel Nova Ban simplify blocking and banning Eloquent models.

Home Page:https://komarev.com/sources/laravel-nova-ban

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ModelWasBanned doesn't trigger in Nova.

rickmacgillis opened this issue · comments

(Continuing the thread from cybercog/laravel-ban#44)

I can unban people and the event triggers in Nova, but when I ban them, the user is banned, but no event gets fired. The observer triggers, but when it gets to $bannable->setBannedFlag($ban->created_at)->save(); it stops afterwards. (See: BanObserver.php Line 48)

EDIT:
I found the issue, and it's because the exception that was thrown was caught in my own version of Laravel Nova Ban. I just forgot to alert the Nova user that it didn't work correctly. (I customized mine with logging when I was just getting started with Nova in its pre-1.0 state. After removing the try/catch block and manual logging, it works just fine. Nova logs them correctly now that it has come of age.)