Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
CRAP
100.00% covered (success)
100.00%
1 / 1
Faq
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 tags
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3declare(strict_types=1);
4
5namespace Engelsystem\Models;
6
7use Carbon\Carbon;
8use Illuminate\Database\Eloquent\Builder;
9use Illuminate\Database\Eloquent\Collection;
10use Illuminate\Database\Eloquent\Factories\HasFactory;
11use Illuminate\Database\Eloquent\Relations\BelongsToMany;
12
13/**
14 * @property int         $id
15 * @property string      $question
16 * @property string      $text
17 * @property Carbon|null $created_at
18 * @property Carbon|null $updated_at
19 *
20 * @property-read Collection|Tag[] $tags
21 *
22 * @method static Builder|Faq whereId($value)
23 * @method static Builder|Faq whereQuestion($value)
24 * @method static Builder|Faq whereText($value)
25 */
26class Faq extends BaseModel
27{
28    use HasFactory;
29
30    /** @var bool Enable timestamps */
31    public $timestamps = true; // phpcs:ignore
32
33    /** @var string The models table */
34    public $table = 'faq'; // phpcs:ignore
35
36    /** @var array<string> */
37    protected $fillable = [ // phpcs:ignore
38        'question',
39        'text',
40    ];
41
42    public function tags(): BelongsToMany
43    {
44        return $this->belongsToMany(Tag::class, 'faq_tags');
45    }
46}