Upload::classRoom()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace App\Models;
4
5
use Illuminate\Database\Eloquent\Model;
6
7
class Upload extends Model  {
8
9
    /**
10
     * The database table used by the model.
11
     *
12
     * @var string
13
     */
14
    protected $table = 'uploads';
15
16
    /**
17
     * Attributes that should be mass-assignable.
18
     *
19
     * @var array
20
     */
21
    protected $fillable = ['security_user_id', 'institution_id', 'institution_class_id', 'model', 'filename', 'deleted_at'];
22
23
    /**
24
     * The attributes excluded from the model's JSON form.
25
     *
26
     * @var array
27
     */
28
    protected $hidden = [];
29
30
    /**
31
     * The attributes that should be casted to native types.
32
     *
33
     * @var array
34
     */
35
    protected $casts = [];
36
37
    /**
38
     * The attributes that should be mutated to dates.
39
     *
40
     * @var array
41
     */
42
    protected $dates = ['deleted_at'];
43
44
    public $timestamps = true;
45
46
    public function user(){
47
        return $this->belongsTo('App\Models\Security_user','security_user_id');
48
    }
49
50
    public function classRoom(){
51
        return $this->belongsTo('App\Models\Institution_class','institution_class_id');
52
    }
53
54
}
55