UserCredit   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
c 0
b 0
f 0
lcom 0
cbo 2
dl 0
loc 25
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A type() 0 4 1
A user() 0 4 1
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 UserCredit.
14
 *
15
 * @property int $id
16
 * @property int $user_id
17
 * @property int $game_id
18
 * @property int $credit_type_id
19
 * @property \Carbon\Carbon $created_at
20
 * @property \Carbon\Carbon $updated_at
21
 * @method static \Illuminate\Database\Query\Builder|\App\Models\UserCredit whereId($value)
22
 * @method static \Illuminate\Database\Query\Builder|\App\Models\UserCredit whereUserId($value)
23
 * @method static \Illuminate\Database\Query\Builder|\App\Models\UserCredit whereGameId($value)
24
 * @method static \Illuminate\Database\Query\Builder|\App\Models\UserCredit whereCreditTypeId($value)
25
 * @method static \Illuminate\Database\Query\Builder|\App\Models\UserCredit whereCreatedAt($value)
26
 * @method static \Illuminate\Database\Query\Builder|\App\Models\UserCredit whereUpdatedAt($value)
27
 * @mixin \Eloquent
28
 * @property-read \App\Models\UserCreditType $type
29
 * @property-read \App\Models\User $user
30
 * @property-read \Illuminate\Database\Eloquent\Collection|\Venturecraft\Revisionable\Revision[] $revisionHistory
31
 */
32
class UserCredit extends Model
33
{
34
    use \Venturecraft\Revisionable\RevisionableTrait;
35
    protected $table = 'user_credits';
36
37
    public $timestamps = true;
38
39
    protected $fillable = [
40
        'user_id',
41
        'game_id',
42
        'credit_type_id',
43
    ];
44
45
    protected $guarded = [];
46
47
    public function type()
48
    {
49
        return $this->hasOne('App\Models\UserCreditType', 'id', 'credit_type_id');
50
    }
51
52
    public function user()
53
    {
54
        return $this->hasOne('App\Models\User', 'id', 'user_id');
55
    }
56
}
57