Conditions | 1 |
Paths | 1 |
Total Lines | 11 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
35 | private function getAllPageModels(): Collection |
||
36 | { |
||
37 | return collect(app(Registry::class)->models()) |
||
38 | // Filter out fragment models |
||
39 | ->filter(function ($model) { |
||
40 | return ! in_array('Thinktomorrow\Chief\Fragments\Fragmentable', class_implements($model)); |
||
41 | // Return all instances of the models |
||
42 | })->map(function ($model) { |
||
43 | return $model::all(); |
||
44 | // Flatten all models to the same level |
||
45 | })->flatten(1); |
||
46 | } |
||
48 |