Completed
Branch master (a6481d)
by Fèvre
02:09
created

Category   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A slugStrategy() 0 4 1
A articles() 0 4 1
1
<?php
2
namespace Xetaravel\Models;
3
4
use Eloquence\Behaviours\Sluggable;
5
6
class Category extends Model
7
{
8
    use Sluggable;
9
10
    /**
11
     * Return the field to slug.
12
     *
13
     * @return string
14
     */
15
    public function slugStrategy(): string
16
    {
17
        return 'title';
18
    }
19
20
    /**
21
     * Get the articles for the category.
22
     */
23
    public function articles()
24
    {
25
        return $this->hasMany('Xetaravel\Models\Article');
26
    }
27
}
28