Participant   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 20
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A scopeByWhom() 0 8 1
1
<?php
2
3
namespace Transmissor\Models\Messenger;
4
5
use App\Models\User;
6
use Cmgmyr\Messenger\Models\Participant as MessengerParticipant;
7
8
class Participant extends MessengerParticipant
9
{
10
    public function scopeByWhom($query, $user_id)
11
    {
12
        /**
13
          *      'actorable_type' => User::class,
14
          *      'actorable_id' => Auth::id()
15
                */
16
        return $query->where('actorable_type', '=', User::class)->where('actorable_id', '=', $user_id);
17
    }
18
19
    // public static function boot()
20
    // {
21
    //     static::updating(function ($model) {
22
    //         // do some logging
23
    //         // override some property like $model->something = transform($something);
24
    //     });
25
    //     parent::boot();
26
    // }
27
}
28