cybercog / laravel-ban

Laravel Ban simplify blocking and banning Eloquent models.

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dosen´t refresh the collection when I ban a user

olkotz opened this issue · comments

Hi everyone! Excelent work with the package!!!

I have found in one of my tests that the variable that contained the user model instance was not updated after applying the ban() function to it.

Example:
$user = User::find($id);
$user->ban();
if i look into the $user dosen´t have updated the field banned_at.

I think this should not be the case and should be updated.
Hope this helps!

Thanks!!!

How can we reproduce this issue? How are you checking that model was not updated?

I was able to reproduce this issue, with PHP 8.0 and Laravel 9, I'm not sure if this is a cache configuration, I did it through tinker @antonkomarev

It will be great to reproduce bug in integration tests, it will help a lot

@antonkomarev Sure, I'll try to add a test