<?php

namespace App\Models;

use App\Traits\Uuid;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Kegiatan extends Model
{
    use HasFactory;
    use Uuid;

    public $incrementing = false;
    protected $table = 'kegiatan';
    protected $keyType = 'string';

    protected $fillable = [
        'id',
        'nama',
        'harga'
    ];

    public function rKegiatan() {
        return $this->belongsToMany(Registrasi::class, 'id_kegiatan', 'id');
    }

    public function pkKegiatanPeserta() {
        return $this->hasMany(KegiatanPeserta::class, 'id_kegiatan', 'id');
    }
}
