Conditions | 3 |
Paths | 4 |
Total Lines | 18 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
14 | public static function list($type = 'post') |
||
15 | { |
||
16 | $dir = 'post-layouts'; |
||
17 | if ($type != 'post') { |
||
18 | $dir = $type.'-layouts'; |
||
19 | } |
||
20 | $postTemplatefilesList = collect([]); |
||
21 | $postTemplatefiles = Storage::disk($dir)->files(''); |
||
22 | |||
23 | foreach ($postTemplatefiles as $postTemplatefile) { |
||
24 | $name = substr($postTemplatefile, 0, strpos($postTemplatefile, '.blade.php')); |
||
25 | $postTemplatefilesList[] = [ |
||
26 | 'name' => $name, |
||
27 | 'path' => 'blog.'.$dir.'.'.$name, |
||
28 | ]; |
||
29 | } |
||
30 | |||
31 | return $postTemplatefilesList; |
||
32 | } |
||
34 |