ProjectMilestone   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 28
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A project() 0 3 1
A user() 0 3 1
1
<?php
2
3
namespace App;
4
5
use Illuminate\Database\Eloquent\Model;
6
use Illuminate\Database\Eloquent\SoftDeletes;
7
8
class ProjectMilestone extends Model
9
{
10
    use SoftDeletes;
11
    
12
    /* @var array $fillable The fields which are mass assignable */
13
    protected $fillable = ['title', 'user_id', 'project_id', 'completed_at'];
14
15
    /* @var array $dates The fields which are mutated to carbon instances */
16
    public $dates = ['completed_at'];
17
18
    /**
19
     * A milestone belongs to a project
20
     *
21
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
22
     */
23
    public function project()
24
    {
25
        return $this->belongsTo(Project::class);
26
    }
27
28
    /**
29
     * A milestone belongs to a user
30
     *
31
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
32
     */
33
    public function user()
34
    {
35
        return $this->belongsTo(User::class);
36
    }
37
}
38