BoardCat   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
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 27
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A threads() 0 4 1
A last_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 GeneaLabs\LaravelModelCaching\Traits\Cachable;
11
use Illuminate\Database\Eloquent\Model;
12
13
/**
14
 * Class BoardCat.
15
 *
16
 * @property int $id
17
 * @property int $order
18
 * @property string $title
19
 * @property string $desc
20
 * @property int $last_user_id
21
 * @property \Carbon\Carbon $created_at
22
 * @property \Carbon\Carbon $updated_at
23
 * @property string $last_created_at
24
 * @method static \Illuminate\Database\Query\Builder|\App\Models\BoardCat whereId($value)
25
 * @method static \Illuminate\Database\Query\Builder|\App\Models\BoardCat whereOrder($value)
26
 * @method static \Illuminate\Database\Query\Builder|\App\Models\BoardCat whereTitle($value)
27
 * @method static \Illuminate\Database\Query\Builder|\App\Models\BoardCat whereDesc($value)
28
 * @method static \Illuminate\Database\Query\Builder|\App\Models\BoardCat whereLastUserId($value)
29
 * @method static \Illuminate\Database\Query\Builder|\App\Models\BoardCat whereCreatedAt($value)
30
 * @method static \Illuminate\Database\Query\Builder|\App\Models\BoardCat whereUpdatedAt($value)
31
 * @method static \Illuminate\Database\Query\Builder|\App\Models\BoardCat whereLastCreatedAt($value)
32
 * @mixin \Eloquent
33
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\BoardThread[] $threads
34
 * @property-read \App\Models\User $last_user
35
 * @property-read \Illuminate\Database\Eloquent\Collection|\Venturecraft\Revisionable\Revision[] $revisionHistory
36
 */
37
class BoardCat extends Model
38
{
39
    use \Venturecraft\Revisionable\RevisionableTrait;
40
    protected $table = 'board_cats';
41
42
    public $timestamps = true;
43
44
    protected $fillable = [
45
        'order',
46
        'title',
47
        'desc',
48
        'last_user_id',
49
        'last_created_at',
50
    ];
51
52
    protected $guarded = [];
53
54
    public function threads()
55
    {
56
        return $this->hasMany('App\Models\BoardThread', 'cat_id', 'id');
57
    }
58
59
    public function last_user()
60
    {
61
        return $this->hasOne('App\Models\User', 'id', 'last_user_id');
62
    }
63
}
64