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
Privilege
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
 groups
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 Illuminate\Database\Eloquent\Builder;
8use Illuminate\Database\Eloquent\Collection;
9use Illuminate\Database\Eloquent\Factories\HasFactory;
10use Illuminate\Database\Eloquent\Relations\BelongsToMany;
11
12/**
13 * @property int                     $id
14 * @property string                  $name
15 * @property string                  $description
16 *
17 * @property-read Collection|Group[] $groups
18 *
19 * @method static Builder|Privilege whereId($value)
20 * @method static Builder|Privilege whereName($value)
21 * @method static Builder|Privilege whereDescription($value)
22 */
23class Privilege extends BaseModel
24{
25    use HasFactory;
26
27    /** @var array<string> */
28    protected $fillable = [ // phpcs:ignore
29        'name',
30        'description',
31    ];
32
33    public function groups(): BelongsToMany
34    {
35        return $this->belongsToMany(Group::class, 'group_privileges');
36    }
37}