Conditions | 3 |
Paths | 1 |
Total Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
34 | protected function subscribe() |
||
35 | { |
||
36 | $events = $this->laravel['events']; |
||
37 | $events->listen('eloquent.*', function ($event, $models) { |
||
38 | if (Str::contains($event, 'eloquent.retrieved')) { |
||
39 | foreach ($models as $model) { |
||
40 | $class = get_class($model); |
||
41 | $this->models[$class] = ($this->models[$class] ?? 0) + 1; |
||
42 | $this->total++; |
||
43 | } |
||
44 | } |
||
45 | }); |
||
46 | } |
||
47 | |||
63 |