-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRole.php
60 lines (54 loc) · 1.47 KB
/
Role.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
namespace App\Models;
use Database\Factories\RoleFactory;
use Eloquent;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Support\Carbon;
/**
* App\Models\Role
*
* @property int $id
* @property Carbon|null $created_at
* @property Carbon|null $updated_at
* @property string $name
* @property-read Collection|Event[] $events
* @property-read int|null $events_count
* @property-read Collection|User[] $users
* @property-read int|null $users_count
*
* @method static RoleFactory factory(...$parameters)
* @method static Builder|Role newModelQuery()
* @method static Builder|Role newQuery()
* @method static Builder|Role query()
* @method static Builder|Role whereCreatedAt($value)
* @method static Builder|Role whereId($value)
* @method static Builder|Role whereName($value)
* @method static Builder|Role whereUpdatedAt($value)
*
* @mixin Eloquent
*/
class Role extends Model
{
use HasFactory;
protected $fillable = [
'name',
];
/**
* @return BelongsToMany<User>
*/
public function users(): BelongsToMany
{
return $this->belongsToMany(User::class);
}
/**
* @return BelongsToMany<Event>
*/
public function events(): BelongsToMany
{
return $this->belongsToMany(Event::class);
}
}