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

Category::articles()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
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