Passed
Push — master ( f2853f...521d03 )
by Curtis
04:30
created

Family   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A person() 0 3 1
A personList() 0 4 1
1
<?php
2
3
namespace App;
4
5
use Illuminate\Database\Eloquent\Model;
6
use LaravelEnso\Tables\App\Traits\TableCache;
7
use LaravelEnso\People\App\Models\Person;
8
9
class Family extends Model
10
{
11
	use TableCache;
12
 protected $fillable = ['description', 'is_active', 'father_id', 'mother_id', 'type_id'];
13
14
    protected $attributes = ['is_active' => false];
15
16
    protected $casts = ['is_active' => 'boolean'];
17
18
    public function person()
19
    {
20
        return $this->belongsToMany(Person::class);
21
22
    }
23
24
    public static function personList()
25
    {
26
        return Person::pluck('name')
27
            ->toArray();
28
    }
29
30
}
31