Total Complexity | 2 |
Total Lines | 34 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
13 | #[ObservedBy([DiscussUserObserver::class])] |
||
14 | class DiscussUser extends Model |
||
15 | { |
||
16 | use HasCounts; |
||
17 | |||
18 | /** |
||
19 | * The attributes that are mass assignable. |
||
20 | * |
||
21 | * @var array |
||
22 | */ |
||
23 | protected $fillable = [ |
||
24 | 'user_id', |
||
25 | 'conversation_id' |
||
26 | ]; |
||
27 | |||
28 | /** |
||
29 | * Get the user that owns the user. |
||
30 | * |
||
31 | * @return BelongsTo |
||
32 | */ |
||
33 | public function user(): BelongsTo |
||
34 | { |
||
35 | return $this->belongsTo(User::class); |
||
36 | } |
||
37 | |||
38 | /** |
||
39 | * Get the conversation that owns the user. |
||
40 | * |
||
41 | * @return BelongsTo |
||
42 | */ |
||
43 | #[CountedBy(as: 'user_count')] |
||
47 | } |
||
48 | } |
||
49 |