Cloee Docs
Paymenter ExtensionsSafeGuard

CLI Reference

Account Protection registers several artisan commands under the account-protection namespace. These are useful for emergency egress (e.g., when staff IPs are bl

Account Protection registers several artisan commands under the account-protection namespace. These are useful for emergency egress (e.g., when staff IPs are blocked) or for scripting changes.

Run php artisan list account-protection to view all commands.

Terminal command cookbook

Run these from your Paymenter folder. Every command prints what it did; destructive ones ask for confirmation first (add --no-interaction or --force for scripts).

Banning IPs (ip-ban:add)

# Ban one IP forever, with a reason
php artisan account-protection:ip-ban:add 203.0.113.7 --reason "comment spam"

# Ban one IP for 2 hours (auto-released afterwards)
php artisan account-protection:ip-ban:add 203.0.113.7 --reason "brute force" --minutes 120

# Ban one IP for a full day
php artisan account-protection:ip-ban:add 203.0.113.7 --reason "scanning" --minutes 1440

# Ban one IP for a week
php artisan account-protection:ip-ban:add 203.0.113.7 --reason "repeat abuse" --minutes 10080

# Ban a whole network range (CIDR)
php artisan account-protection:ip-ban:add 203.0.113.0/24 --reason "hostile network"

# Ban an IPv6 address
php artisan account-protection:ip-ban:add 2001:db8::1 --reason "abuse" --minutes 60

# Quick temporary block while you investigate (30 minutes, no reason needed)
php artisan account-protection:ip-ban:add 198.51.100.23 --minutes 30

# Re-banning an already-banned IP replaces the old ban (safe to repeat)
php artisan account-protection:ip-ban:add 203.0.113.7 --reason "still at it" --minutes 60

# See the ban you just made
php artisan account-protection:ip-ban:list --active

# Invalid input is rejected instead of creating a broken ban
php artisan account-protection:ip-ban:add not-an-ip

Releasing IPs (ip-ban:release)

# Unban one IP
php artisan account-protection:ip-ban:release 203.0.113.7

# Unban several IPs at once — clean ones are skipped, never an error
php artisan account-protection:ip-ban:release 203.0.113.7 198.51.100.23 192.0.2.44

# Unban a whole list with per-IP reporting (banned ones released, the rest skipped)
php artisan account-protection:ip-ban:release 203.0.113.7 198.51.100.23 --notes "appeal approved"

# Unban from a file (one IP or range per line, # = comment, blanks ignored)
php artisan account-protection:ip-ban:release --file unbans.txt

# Preview a list unban without changing anything
php artisan account-protection:ip-ban:release 203.0.113.7 198.51.100.23 --dry-run

# Unban one IP and leave a note (visible in the ban history)
php artisan account-protection:ip-ban:release 203.0.113.7 --notes "customer called support"

# Unban a whole range by its exact range address
php artisan account-protection:ip-ban:release 203.0.113.0/24

# Preview what WOULD be released, changing nothing
php artisan account-protection:ip-ban:release --all --dry-run

# Unban everything (asks "are you sure?" first when it matches several)
php artisan account-protection:ip-ban:release --all

# Unban everything without asking (for scripts / emergencies)
php artisan account-protection:ip-ban:release --all --no-interaction

# Only release bans whose time already ran out
php artisan account-protection:ip-ban:release --expired

# Only release bans older than a day (1440 minutes)
php artisan account-protection:ip-ban:release --older-than=1440

# Only release bans older than a week, with a note
php artisan account-protection:ip-ban:release --older-than=10080 --notes "weekly cleanup"

# Trying to release an IP that is only covered by a range ban explains
# itself instead of silently unbanning the whole range
php artisan account-protection:ip-ban:release 203.0.113.55

Listing and inspecting bans (ip-ban:list)

# Show every ban, newest first
php artisan account-protection:ip-ban:list

# Show only bans that are still enforced right now
php artisan account-protection:ip-ban:list --active

Banning many IPs at once (ip-ban:import)

# Ban several IPs in one go
php artisan account-protection:ip-ban:import --ip=203.0.113.7 --ip=198.51.100.23 --reason "spam wave"

# Preview an import without creating anything
php artisan account-protection:ip-ban:import --ip=203.0.113.7 --dry-run

# Ban everything listed in a file (one IP or range per line, # = comment)
php artisan account-protection:ip-ban:import --file bans.txt --reason "abuse feed"

# Import temporary bans (all expire after 60 minutes)
php artisan account-protection:ip-ban:import --file bans.txt --minutes 60

# Mix file + command line in one import
php artisan account-protection:ip-ban:import --file bans.txt --ip=203.0.113.99 --reason "incident #42"

# Bad lines are reported and nothing is imported
php artisan account-protection:ip-ban:import --file bans.txt

Example bans.txt:

# VPN exit nodes seen today
203.0.113.7
198.51.100.0/24
2001:db8::/32

Tidying up old bans (ip-ban:prune)

# Preview: what would be released + permanently deleted
php artisan account-protection:ip-ban:prune --dry-run

# Release finished bans and delete records older than 90 days (default)
php artisan account-protection:ip-ban:prune

# Keep only the last 30 days of ban history
php artisan account-protection:ip-ban:prune --days=30

# Keep a full year of history, only releasing finished bans
php artisan account-protection:ip-ban:prune --days=365

# (Runs automatically every day on its own — manual runs are for catch-up.)

IP whitelist (ip-whitelist:*)

# Whitelist your office IP with a note (all bypasses on by default)
php artisan account-protection:ip-whitelist:add 203.0.113.7 --notes "office"

# Whitelist a monitoring range
php artisan account-protection:ip-whitelist:add 198.51.100.0/24 --notes "uptime monitor"

# Whitelist an IP but still enforce VPN detection on it
php artisan account-protection:ip-whitelist:add 203.0.113.7 --no-vpn

# Whitelist an IP but still count it for the registration limit + login throttle
php artisan account-protection:ip-whitelist:add 203.0.113.7 --no-registration --no-fail2ban

# Change flags later without losing the note (notes are kept unless --notes is passed)
php artisan account-protection:ip-whitelist:add 203.0.113.7 --no-tor

# See everything whitelisted, including bypass flags and notes
php artisan account-protection:ip-whitelist:list

# Remove one IP from the whitelist
php artisan account-protection:ip-whitelist:remove 203.0.113.7

# Back up the whitelist to a file (JSON by default)
php artisan account-protection:ip-whitelist:export

# Back up to a specific file as CSV (opens in Excel)
php artisan account-protection:ip-whitelist:export /tmp/whitelist.csv --format=csv

# Restore from a backup file (format detected from the extension)
php artisan account-protection:ip-whitelist:import /tmp/whitelist.json

# Replace the whole whitelist with a file (asks first; --force skips asking)
php artisan account-protection:ip-whitelist:import /tmp/whitelist.json --replace --force

# See which ready-made lists ship with the extension
php artisan account-protection:ip-whitelist:import-bundled --list

# Import Cloudflare's IP ranges so Cloudflare traffic is never flagged
php artisan account-protection:ip-whitelist:import-bundled cloudflare

# Import everything bundled (Cloudflare + HetrixTools monitoring)
php artisan account-protection:ip-whitelist:import-bundled --all

# Empty the entire IP whitelist (asks first)
php artisan account-protection:ip-whitelist:clear

Account whitelist (account-whitelist:*)

# Whitelist a customer by email (all bypasses on by default)
php artisan account-protection:account-whitelist:add [email protected] --notes "VIP"

# Whitelist a customer by user ID
php artisan account-protection:account-whitelist:add 42

# Whitelist but still enforce the registration limit on them
php artisan account-protection:account-whitelist:add [email protected] --no-registration

# Whitelist but still run VPN/proxy checks on them
php artisan account-protection:account-whitelist:add [email protected] --no-vpn --no-proxy

# Change flags later without losing the note
php artisan account-protection:account-whitelist:add [email protected] --no-tor

# See every whitelisted account with its bypasses
php artisan account-protection:account-whitelist:list

# Remove one account from the whitelist
php artisan account-protection:account-whitelist:remove [email protected]

# Empty the entire account whitelist without asking
php artisan account-protection:account-whitelist:clear --force

Login history (ip-log:list)

# Last 20 recorded logins/registrations
php artisan account-protection:ip-log:list

# Last 50 entries
php artisan account-protection:ip-log:list --limit=50

# Everything for one customer (email or user ID)
php artisan account-protection:ip-log:list [email protected]
php artisan account-protection:ip-log:list --user=42

# Combine both filters
php artisan account-protection:ip-log:list [email protected] --limit=100

# (Limit must be between 1 and 1000 — anything else is rejected.)

Email blocklist (email-blocklist:sync)

# Refresh the throwaway-domain list now (normally automatic every day)
php artisan account-protection:email-blocklist:sync --force

# Refresh only if the configured interval has passed
php artisan account-protection:email-blocklist:sync

Login throttle cleanup (login-throttle:prune)

# Delete old login attempts and finished login bans per your retention settings
php artisan account-protection:login-throttle:prune

# (Runs automatically every day on its own — manual runs are for catch-up.)

IP Whitelist Commands

Add

# Single IP
php artisan account-protection:ip-whitelist:add 203.0.113.5 \
  --notes="Finance office" \
  --no-registration       # optional flags disable specific bypasses

# CIDR range
php artisan account-protection:ip-whitelist:add 173.245.48.0/20 \
  --notes="Cloudflare IPv4"

Flags available:

  • --notes= – store additional context
  • --no-registration – do not bypass registration limit
  • --no-vpn / --no-proxy / --no-tor / --no-relay

Remove

php artisan account-protection:ip-whitelist:remove 203.0.113.5

List

php artisan account-protection:ip-whitelist:list

Shows all whitelist entries and their bypass flags.

Clear

php artisan account-protection:ip-whitelist:clear
# add --force to skip confirmation

Export

php artisan account-protection:ip-whitelist:export storage/app/ip-whitelist.json
# --format=csv to export as CSV (default is json)
# --force overwrites existing files

If you omit the path, the command writes to storage/app/account_protection_ip_whitelist_<timestamp>.<ext>.

Import

php artisan account-protection:ip-whitelist:import storage/app/ip-whitelist.json \
  --format=json \
  --replace \
  --force
  • --format= is optional when the extension (.json/.csv) matches the payload.
  • --replace wipes the current whitelist before importing (prompted unless --force is present).
  • The command reports Created/Updated/Skipped counts so you can audit the load.

File Layout

JSON expects an array of objects:

[
  {
    "ip_address": "203.0.113.10",
    "notes": "Finance office",
    "bypass_registration": true,
    "bypass_vpn": true,
    "bypass_proxy": false,
    "bypass_tor": false,
    "bypass_relay": true
  }
]

CSV requires these lowercase headers (1/0, true/false, yes/no all map to booleans):

ip_address,notes,bypass_registration,bypass_vpn,bypass_proxy,bypass_tor,bypass_relay
203.0.113.10,Finance office,1,1,0,0,1

Account Whitelist Commands

Whitelist specific user accounts to bypass VPN/proxy detection. Useful for staff or VIP customers who may use VPNs legitimately.

Add

# By email
php artisan account-protection:account-whitelist:add [email protected] \
  --notes="VIP customer"

# By user ID
php artisan account-protection:account-whitelist:add 42 \
  --notes="Staff member" \
  --no-vpn                # optional flags disable specific bypasses

Flags available:

  • --notes= – store additional context
  • --no-vpn / --no-proxy / --no-tor / --no-relay

Remove

php artisan account-protection:account-whitelist:remove [email protected]
# or by ID
php artisan account-protection:account-whitelist:remove 42

List

php artisan account-protection:account-whitelist:list

Shows all whitelisted accounts with their bypass flags.

Clear

php artisan account-protection:account-whitelist:clear
# add --force to skip confirmation

IP Ban Commands

Add a Ban

php artisan account-protection:ip-ban:add 198.51.100.9 \
  --reason="Chargeback fraud" \
  --minutes=1440          # optional expiry in minutes

Release a Ban

php artisan account-protection:ip-ban:release 198.51.100.9 \
  --notes="Verified customer"

List Bans

php artisan account-protection:ip-ban:list
php artisan account-protection:ip-ban:list --active   # only active bans

IP Log Commands

List Recent Entries

php artisan account-protection:ip-log:list --limit=50
php artisan account-protection:ip-log:list [email protected]

Shows recorded login/registration IPs, timestamps, and user agents.

Email Blocklist Commands

Sync Disposable Domains

php artisan account-protection:email-blocklist:sync
# add --force to ignore the configured sync interval

The command downloads the disposable domain list (default GitHub source), upserts entries, applies the grace-period removal policy, and prints:

  • Total domains fetched and the source URL
  • Added / updated / removed counts
  • Pending removal count (domains that went missing but are still inside the grace window)
  • A short sample of domains so you can confirm the payload

Use it inside cron or external automation. The extension also registers the command with Laravel’s scheduler when auto-sync is enabled.

Usage Tips

  • Pair these commands with cronjobs or monitoring to export data regularly.
  • All commands return non-zero exit codes when the requested action fails, allowing use inside scripts.
  • When automating via CI/Ansible, run them from the Paymenter root (same directory as artisan).

Troubleshooting

  • If commands are missing, confirm the extension is enabled and the application is running in console mode (no cached config disabling the service provider).
  • Command errors are written to storage/logs/. Use tail -f during execution to watch output live.

These tools provide a safety net when the admin UI is inaccessible or when swift action is required.


On this page