Conditions | 3 |
Paths | 1 |
Total Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
27 | protected function subscribe() |
||
28 | { |
||
29 | $events = $this->laravel['events']; |
||
30 | $events->listen('eloquent.*', function ($event, $models) { |
||
31 | if (Str::contains($event, 'eloquent.retrieved')) { |
||
32 | foreach ($models as $model) { |
||
33 | $class = get_class($model); |
||
34 | $this->models[$class] = ($this->models[$class] ?? 0) + 1; |
||
35 | $this->total++; |
||
36 | } |
||
37 | } |
||
38 | }); |
||
39 | } |
||
40 | |||
54 |