Student   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 6
c 1
b 0
f 1
dl 0
loc 29
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A user() 0 3 1
A compilations() 0 3 1
1
<?php
2
declare(strict_types = 1);
3
4
namespace App\Models;
5
6
use App\Models\Traits\EloquentGetTableName;
7
use Illuminate\Database\Eloquent\Model;
8
use Illuminate\Database\Eloquent\Relations\BelongsTo;
9
use Illuminate\Database\Eloquent\Relations\HasMany;
10
use Illuminate\Database\Eloquent\SoftDeletes;
11
12
class Student extends Model
13
{
14
15
    use SoftDeletes;
16
    use EloquentGetTableName;
17
18
    /**
19
     * The attributes that should be mutated to dates.
20
     *
21
     * @var array
22
     */
23
    protected $dates = ["deleted_at"];
24
25
    /**
26
     * Get the compilations of this student
27
     * @return HasMany
28
     */
29
    public function compilations() : HasMany
30
    {
31
        return $this->hasMany("App\Models\Compilation");
32
    }
33
34
    /**
35
     * Get the user of this student
36
     * @return BelongsTo
37
     */
38
    public function user() : BelongsTo
39
    {
40
        return $this->belongsTo("App\User");
41
    }
42
43
}
44