Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
| Tag | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
| faqs | |
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 Illuminate\Database\Eloquent\Builder; |
| 8 | use Illuminate\Database\Eloquent\Collection; |
| 9 | use Illuminate\Database\Eloquent\Factories\HasFactory; |
| 10 | use Illuminate\Database\Eloquent\Relations\BelongsToMany; |
| 11 | |
| 12 | /** |
| 13 | * @property int $id |
| 14 | * @property string $name |
| 15 | * |
| 16 | * @property-read Collection|Faq[] $faqs |
| 17 | * |
| 18 | * @method static Builder|Group whereId($value) |
| 19 | * @method static Builder|Group whereName($value) |
| 20 | */ |
| 21 | class Tag extends BaseModel |
| 22 | { |
| 23 | use HasFactory; |
| 24 | |
| 25 | /** @var string[] */ |
| 26 | protected $fillable = [ // phpcs:ignore |
| 27 | 'name', |
| 28 | ]; |
| 29 | |
| 30 | public function faqs(): BelongsToMany |
| 31 | { |
| 32 | return $this->belongsToMany(Faq::class, 'faq_tags'); |
| 33 | } |
| 34 | } |