public function deleteExpiredBans(): void
    {
        $bans = Ban::query()
            ->where('expired_at', '<=', Carbon::now()->format('Y-m-d H:i:s'))
            ->get();

        $bans->each(function ($ban) {
            $ban->delete();
        });
    }
public function deleteExpiredBans(): void
    {
        $bans = Ban::query()
            ->where('expired_at', '<=', Carbon::now()->format('Y-m-d H:i:s'))
            ->get();

        $bans->each(function ($ban) {
            $ban->delete();
        });
    }
public function deleteExpiredBans ( ) : void { $ bans = Ban :: query ( ) -> where ( 'expired_at' , '<=' , Carbon :: now ( ) -> format ( 'Y-m-d H:i:s' ) ) -> get ( ) ; $ bans -> each ( function ( $ ban ) { $ ban -> delete ( ) ; } ) ; }
Delete all expired Ban models.

@return void
Delete all expired Ban models .