Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
Faq | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
tags | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | |
3 | declare(strict_types=1); |
4 | |
5 | namespace Engelsystem\Models; |
6 | |
7 | use Carbon\Carbon; |
8 | use Illuminate\Database\Eloquent\Builder; |
9 | use Illuminate\Database\Eloquent\Collection; |
10 | use Illuminate\Database\Eloquent\Factories\HasFactory; |
11 | use 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 | */ |
26 | class 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 | } |