Files
root 574b5d6e17 fix: standardize language to English in README and AlertSettings
feat: add 24 model factories for Help, Shop, Community, Game, User domains

- Translate mixed Dutch/English strings in README.md and AlertSettings.php
- Add HasFactory trait to 23 models
- Create factories for Help (6), Shop (4), Community (5), Game (2), User (7)
2026-05-23 16:57:44 +02:00

39 lines
977 B
PHP
Executable File

<?php
namespace Database\Factories\User;
use App\Models\User;
use App\Models\User\Ban;
use Illuminate\Database\Eloquent\Factories\Factory;
class BanFactory extends Factory
{
protected $model = Ban::class;
public function definition(): array
{
return [
'user_id' => User::factory(),
'user_staff_id' => User::factory(),
'ban_expire' => now()->addDays($this->faker->numberBetween(1, 365))->timestamp,
'type' => $this->faker->randomElement(['account', 'ip', 'machine']),
'reason' => $this->faker->sentence(),
'ip' => $this->faker->ipv4(),
];
}
public function expired(): static
{
return $this->state(fn (array $attributes) => [
'ban_expire' => now()->subDay()->timestamp,
]);
}
public function permanent(): static
{
return $this->state(fn (array $attributes) => [
'ban_expire' => 0,
]);
}
}