Passed
Pull Request — master (#5)
by Maksim
05:00
created

TestRole   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A hex_users() 0 2 1
A users() 0 2 1
1
<?php
2
3
namespace MaksimM\CompositePrimaryKeys\Tests\Stubs;
4
5
use Illuminate\Database\Eloquent\Model;
6
7
class TestRole extends Model
8
{
9
10
    protected $table = 'roles';
11
12
    public $timestamps = false;
13
14
    protected $primaryKey = 'role_id';
15
16
    protected $fillable = [
17
        'name',
18
    ];
19
20
    public function users(){
21
        return $this->hasMany(TestBinaryUser::class, 'role_id', 'role_id');
22
    }
23
24
    public function hex_users(){
25
        return $this->hasMany(TestBinaryUserHex::class, 'role_id', 'role_id');
26
    }
27
28
}
29