Test Setup Failed
Push — development ( ce0609...d418a4 )
by Tim
08:46
created

TasksRequest::requestUser()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace App;
4
5
use Illuminate\Database\Eloquent\Model;
6
7
/**
8
 * Class TasksRequest
9
 * @package App
10
 */
11
class TasksRequest extends Model
12
{
13
    /**
14
     * Mass assign fields.
15
     *
16
     * @var array
17
     */
18
    protected $fillable = [
19
        'requester', 'userid', 'type', 'status',
20
        'startdate', 'enddate', 'description'];
21
22
    /**
23
     * Hidden fields
24
     *
25
     * @var array
26
     */
27
    protected $hidden = ['created_at', 'updated_at'];
28
29
    /**
30
     * The database table used by the model.
31
     *
32
     * @var string
33
     */
34
    protected $table = 'tasks_requests';
35
36
    /**
37
     * TASK -> USER REQUEST. TO DETERMOINE HO IS ASSIGNED
38
     *
39
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
40
     */
41
    public function assignee()
42
    {
43
        return $this->belongsTo('App\User', 'userid', 'id');
44
    }
45
46
    /**
47
     * TASK -> REQUESTER to see the data who request this tasks.
48
     *
49
     */
50
    public function requestUser()
51
    {
52
        return $this->belongsTo('App\User', 'requester', 'id');
53
    }
54
}
55