<?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 GroupBadge extends Model
{
    use HasFactory;

    protected $fillable = [
        'group_id',
        'badge_key',
        'awarded_at',
        'meta_json',
    ];

    protected $casts = [
        'awarded_at' => 'datetime',
        'meta_json' => 'array',
    ];

    public function group(): BelongsTo
    {
        return $this->belongsTo(Group::class);
    }
}