新增每日签到与补签卡功能
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* 文件功能:用户身份徽章测试工厂。
|
||||
*
|
||||
* 用于测试中快速构造签到来源或其他来源的身份徽章。
|
||||
*/
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\User;
|
||||
use App\Models\UserIdentityBadge;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends Factory<UserIdentityBadge>
|
||||
*/
|
||||
class UserIdentityBadgeFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* 定义默认身份徽章测试数据。
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'user_id' => User::factory(),
|
||||
'source' => UserIdentityBadge::SOURCE_SIGN_IN,
|
||||
'badge_code' => 'sign_in_beginner',
|
||||
'badge_name' => '签到新星',
|
||||
'badge_icon' => null,
|
||||
'badge_color' => '#0f766e',
|
||||
'acquired_at' => now(),
|
||||
'expires_at' => null,
|
||||
'is_active' => true,
|
||||
'metadata' => [],
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user