Pendaftaran::user()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Bantenprov\Pendaftaran\Models\Bantenprov\Pendaftaran;
4
5
use Illuminate\Database\Eloquent\Model;
6
use Illuminate\Database\Eloquent\SoftDeletes;
7
8
class Pendaftaran extends Model
9
{
10
    use SoftDeletes;
11
12
    public $timestamps = true;
13
14
    protected $table = 'pendaftarans';
15
    protected $dates = [
16
        'deleted_at'
17
    ];
18
    protected $fillable = [
19
        'kegiatan_id',
20
        'user_id',
21
        'tanggal_pendaftaran',
22
        'sekolah_id',
23
        'nomor_un',
24
    ];
25
26
    public function kegiatan()
27
    {
28
        return $this->belongsTo('Bantenprov\Kegiatan\Models\Bantenprov\Kegiatan\Kegiatan','kegiatan_id');
29
    }
30
31
    public function sekolah()
32
    {
33
        return $this->belongsTo('Bantenprov\Sekolah\Models\Bantenprov\Sekolah\Sekolah','sekolah_id');
34
    }
35
36
    public function user()
37
    {
38
        return $this->belongsTo('App\User','user_id');
39
    }
40
41
    public function siswa()
42
    {
43
        return $this->hasOne('Bantenprov\Siswa\Models\Bantenprov\Siswa\Siswa','user_id');
44
    }
45
    
46
}
47