-
-
Notifications
You must be signed in to change notification settings - Fork 64
Open
Description
Laravel 12.28.1
laravel-ban 4.10
PHP 8.4.13
How to reproduce :
Requirements :
- Create \App\Models\Ban extend \Cog\Laravel\Ban\Models\Ban. (I just add on it the fillable field
preset_id). - Bind the model in AppServiceProvider like this : $this->app->bind(BanContract::class, \App\Models\Ban::class);
- Implement Bannable trait in the user model. (like documentation).
How to use :
To create ban with preset_id use :
$ban = new \App\Models\Ban($data);
$ban->bannable()->associate($bannable);
$ban->save();If you create a ban, and you wait the time of ban, and execute the php artisan ban:delete-expired command, the ban are perfectly softdelete but the flag "banned_at" has not.
As a result, the isBanned() methode are true even though the ban is soft delete in the DB.
I assume that the issue lies with Cog\Laravel\Ban\Observers\BanObserver line 62 verification, which is performed before the data are really updated in database, but i'm not sure.
Has anyone else encountered this problem and found a suitable solution?
**edit :
Some clarification is needed :
$data=> contains all require data for ban.$bannable=> is an instance of a class that can be banned.
Metadata
Metadata
Assignees
Labels
No labels