UserObyx::user()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/*
4
 * rmarchiv.tk
5
 * (c) 2016-2017 by Marcel 'ryg' Hering
6
 */
7
8
namespace App\Models;
9
10
use Illuminate\Database\Eloquent\Model;
11
12
/**
13
 * Class UserObyx.
14
 *
15
 * @property int $id
16
 * @property int $user_id
17
 * @property int $obyx_id
18
 * @property \Carbon\Carbon $created_at
19
 * @property \Carbon\Carbon $updated_at
20
 * @method static \Illuminate\Database\Query\Builder|\App\Models\UserObyx whereId($value)
21
 * @method static \Illuminate\Database\Query\Builder|\App\Models\UserObyx whereUserId($value)
22
 * @method static \Illuminate\Database\Query\Builder|\App\Models\UserObyx whereObyxId($value)
23
 * @method static \Illuminate\Database\Query\Builder|\App\Models\UserObyx whereCreatedAt($value)
24
 * @method static \Illuminate\Database\Query\Builder|\App\Models\UserObyx whereUpdatedAt($value)
25
 * @mixin \Eloquent
26
 * @property-read \App\Models\User $user
27
 * @property-read \App\Models\Obyx $obyx
28
 * @property-read \Illuminate\Database\Eloquent\Collection|\Venturecraft\Revisionable\Revision[] $revisionHistory
29
 */
30
class UserObyx extends Model
31
{
32
    use \Venturecraft\Revisionable\RevisionableTrait;
33
    protected $table = 'user_obyx';
34
35
    public $timestamps = true;
36
37
    protected $fillable = [
38
        'user_id',
39
        'obyx_id',
40
    ];
41
42
    protected $guarded = [];
43
44
    public function user()
45
    {
46
        return $this->belongsTo('App\Models\User', 'user_id', 'id');
47
    }
48
49
    public function obyx()
50
    {
51
        return $this->hasOne('App\Models\Obyx', 'id', 'obyx_id');
52
    }
53
}
54