Category   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 15
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A user() 0 3 1
1
<?php
2
3
namespace App\Models;
4
5
use Illuminate\Database\Eloquent\Model;
6
use Illuminate\Database\Eloquent\Relations\BelongsTo;
7
8
class Category extends Model
9
{
10
    protected $table = 'categories';
11
12
    protected $fillable = [
13
        'name',
14
        'description',
15
        'slug',
16
        'order',
17
        'user_id',
18
    ];
19
20
    public function user(): BelongsTo
21
    {
22
        return $this->belongsTo(User::class, 'user_id', 'id');
23
    }
24
}
25