Configuring UUIDs for Bans
2.xIf your application uses UUIDs instead of auto-incrementing IDs, follow these steps to configure Banhammer:
- Publish migrations and edit the migration file to change
$table->id()to$table->uuid('id'). - Create a custom Ban model that uses the
HasUuidstrait:namespace App\ Models; use Illuminate\Database\Eloquent\Concerns\HasUuids; use Mchev\Banhammer\Models\Ban as BanhammerBan; class Ban extends BanhammerBan { use HasUuids; } - Update the config to point to your new model in
config/ban.php:'model' => \App\Models\Ban::class,
// config/ban.php
'model' => \App\Models\Ban::class,