Skip to content

Commit

Permalink
update ClanFactory
Browse files Browse the repository at this point in the history
Tomut0 committed Dec 14, 2024
1 parent 2a06541 commit f1565fe
Showing 1 changed file with 70 additions and 5 deletions.
75 changes: 70 additions & 5 deletions database/factories/ClanFactory.php
Original file line number Diff line number Diff line change
@@ -20,17 +20,82 @@ class ClanFactory extends Factory
public function definition(): array
{
$tag = fake()->unique()->regexify("[a-zA-Z]{3,7}");

$banner = fake()->randomElement([
"cs:
==: org.bukkit.inventory.ItemStack
v: 3700
type: LIGHT_BLUE_BANNER
meta:
==: ItemMeta
meta-type: BANNER
ItemFlags:
- HIDE_POTION_EFFECTS
patterns:
- ==: Pattern
color: GREEN
pattern: cr
- ==: Pattern
color: LIGHT_GRAY
pattern: cre
- ==: Pattern
color: RED
pattern: dls
", "cs:
==: org.bukkit.inventory.ItemStack
v: 3700
type: LIGHT_BLUE_BANNER
meta:
==: ItemMeta
meta-type: BANNER
ItemFlags:
- HIDE_POTION_EFFECTS
", "cs:
==: org.bukkit.inventory.ItemStack
v: 3700
type: CYAN_BANNER
meta:
==: ItemMeta
meta-type: BANNER
ItemFlags:
- HIDE_POTION_EFFECTS
patterns:
- ==: Pattern
color: BLUE
pattern: cre
- ==: Pattern
color: BLACK
pattern: sku
", ""
]);

$colors = ['§4', '§2', '§3', '§f', '§9', '§6', '§c', '§8'];
$color = fake()->randomElement($colors);
$color_tag = "$color$tag";

$lastUsed = fake()->unixTime() * 1000;
$founded = fake()->unixTime($lastUsed);

$packed_bb = "${founded}_Clan ${tag} created";

return [
'verified' => fake()->boolean(),
'tag' => $tag,
'color_tag' => $tag,
'name' => fake()->unique()->company(),
'color_tag' => $color_tag,
'name' => join(' ', fake()->unique()->words(rand(1, 2))),
'description' => fake()->realText(),
'friendly_fire' => fake()->boolean(),
'founded' => fake()->unixTime(),
'last_used' => fake()->unixTime(),
'founded' => $founded,
'last_used' => $lastUsed,
'balance' => fake()->numberBetween(0, 1000),
'fee_enabled' => fake()->boolean(),
'flags' => "{}",
'flags' => "{\"warring\":[]}",
'packed_bb' => $packed_bb,
'packed_allies' => '',
'packed_rivals' => '',
'cape_url' => '',
'ranks' => '',
'banner' => $banner,
];
}
}

0 comments on commit f1565fe

Please sign in to comment.