Completed
Push — master ( 592ea7...0d3d46 )
by
unknown
02:14 queued 51s
created

Pendaftaran::siswa()   A

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
    ];
24
25
    public function kegiatan()
26
    {
27
        return $this->belongsTo('Bantenprov\Kegiatan\Models\Bantenprov\Kegiatan\Kegiatan','kegiatan_id');
28
    }
29
30
    public function sekolah()
31
    {
32
        return $this->belongsTo('Bantenprov\Sekolah\Models\Bantenprov\Sekolah\Sekolah','sekolah_id');
33
    }
34
35
    public function user()
36
    {
37
        return $this->belongsTo('App\User','user_id');
38
    }
39
40
    public function siswa()
41
    {
42
        return $this->hasOne('Bantenprov\Siswa\Models\Bantenprov\Siswa\Siswa','user_id');
43
    }
44
    
45
}
46