37 lines
702 B
PHP
37 lines
702 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class GroupMemberBadge extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $fillable = [
|
|
'group_id',
|
|
'user_id',
|
|
'badge_key',
|
|
'awarded_at',
|
|
'meta_json',
|
|
];
|
|
|
|
protected $casts = [
|
|
'awarded_at' => 'datetime',
|
|
'meta_json' => 'array',
|
|
];
|
|
|
|
public function group(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Group::class);
|
|
}
|
|
|
|
public function user(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
} |