Skip to content

Commit

Permalink
Manually unban expired bans
Browse files Browse the repository at this point in the history
  • Loading branch information
mchev committed Feb 12, 2023
1 parent f3cb925 commit c818b77
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,15 @@ $user->unban();

### IP

Manually ban IPs
Ban IPs
```php
use Mchev\Banhammer\IP;

IP::ban("8.8.8.8");
IP::ban(["8.8.8.8", "4.4.4.4"]);
```

Manually unban IPs
Unban IPs
```php
use Mchev\Banhammer\IP;

Expand All @@ -123,8 +123,8 @@ List all banned IPs
```php
use Mchev\Banhammer\IP;

$ips = IP::banned()->get();
$arrayOfBannedIps = IP::banned()->pluck('ip')->toArray();
$ips = IP::banned()->get(); // Collection
$ips = IP::banned()->pluck('ip')->toArray(); // Array
```

### Middleware
Expand Down Expand Up @@ -167,11 +167,23 @@ Is entity is unbanned `Mchev\Banhammer\Events\ModelWasUnbanned` event is fired.

### MISC

To manually unban expired bans :
```php
use Mchev\Banhammer\Banhammer;

Banhammer::unbanExpired();
```

Or you can use the command:
```bash
php artisan banhammer:unban
```

To permanently delete all the expired bans :
```php
use Mchev\Banhammer\Banhammer;

$ips = Banhammer::clear();
Banhammer::clear();
```

Or you can use the command:
Expand Down

0 comments on commit c818b77

Please sign in to comment.