Registrasi.php 1.04 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
<?php

namespace App\Models;

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

class Registrasi extends Model
{
    use HasFactory;
    use Uuid;

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

    protected $fillable = [
        'id',
        'nama',
        'nama_depan',
        'email',
        'telepon',
        'instansi',
        'jabatan',
        'id_kegiatan',
        'id_konferensi',
        'alamat',
        'kode_pos',
        'kota',
31 32 33
        'kode_registrasi',
        'tagihan',
        'status_va',
34 35 36
        'tanggal_bayar',
        'urutan',
        'nik'
37 38 39 40 41 42 43 44 45
    ];

    public function pkKegiatan(){
        return $this->hasOne(Kegiatan::class, 'id', 'id_kegiatan');
    }

    public function pkKonferensi() {
        return $this->hasOne(Konferensi::class, 'id', 'id_konferensi');
    }
46 47 48 49

    public function pkRegistrasiPeserta() {
        return $this->hasMany(KegiatanPeserta::class, 'id_registrasi', 'id');
    }
50
}