FaqItem   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 8
dl 0
loc 26
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A sluggable() 0 5 1
A faqItemGroup() 0 3 1
1
<?php 
2
3
namespace Hideyo\Ecommerce\Framework\Services\Faq\Entity;
4
5
use Hideyo\Ecommerce\Framework\Services\BaseModel;
6
use Cviebrock\EloquentSluggable\Sluggable;
7
8
class FaqItem extends BaseModel {
9
10
    use Sluggable;
11
12
    /**
13
     * The database table used by the model.
14
     *
15
     * @var string
16
     */
17
    protected $table = 'faq_item';
18
19
    // Add the 'avatar' attachment to the fillable array so that it's mass-assignable on this model.
20
    protected $fillable = ['id', 'faq_item_group_id', 'question', 'answer', 'slug', 'shop_id'];
21
22
    public function sluggable()
23
    {
24
        return [
25
            'slug' => [
26
                'source' => 'question'
27
            ]
28
        ];
29
    }
30
31
    public function faqItemGroup()
32
    {
33
        return $this->belongsTo('Hideyo\Ecommerce\Framework\Services\Faq\Entity\faqItemGroup');
34
    }
35
}