Passed
Push — master ( 5b96e8...c2fbb6 )
by Mike
04:38
created

UncachedAuthor::profile()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 0
1
<?php namespace GeneaLabs\LaravelModelCaching\Tests\Fixtures;
2
3
use Illuminate\Database\Eloquent\Model;
4
use Illuminate\Database\Eloquent\Relations\HasMany;
5
use Illuminate\Database\Eloquent\Relations\HasOne;
6
7
class UncachedAuthor extends Model
8
{
9
    protected $fillable = [
10
        'name',
11
        'email',
12
    ];
13
    protected $table = 'authors';
14
15
    public function books() : HasMany
16
    {
17
        return $this->hasMany(UncachedBook::class, 'author_id', 'id');
18
    }
19
20
    public function profile() : HasOne
21
    {
22
        return $this->hasOne(UncachedProfile::class, 'author_id', 'id');
23
    }
24
}
25