FaqItem::faqItemGroup()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

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