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

Family::person()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
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