Files
chatroom/database/factories/VipLevelFactory.php

38 lines
948 B
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
/**
* 文件功能VIP 等级测试工厂
* 用于在测试中快速生成可购买的 VIP 等级数据
*/
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\VipLevel>
*/
class VipLevelFactory extends Factory
{
/**
* 定义默认测试数据
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'name' => '测试会员'.fake()->unique()->numberBetween(1, 9999),
'icon' => '👑',
'color' => '#f59e0b',
'exp_multiplier' => 1.5,
'jjb_multiplier' => 1.2,
'join_templates' => null,
'leave_templates' => null,
'sort_order' => fake()->numberBetween(1, 20),
'price' => fake()->numberBetween(10, 99),
'duration_days' => 30,
];
}
}