Conditions | 2 |
Paths | 2 |
Total Lines | 25 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
19 | public function show() |
||
20 | { |
||
21 | $resources_template = Lang::get('common/resources'); |
||
22 | $resources = []; |
||
23 | |||
24 | // Iterate through resource files, and push link type array into resources array. |
||
25 | $files = Resource::all(); |
||
26 | foreach ($files as $file) { |
||
27 | array_push($resources, [ |
||
28 | 'link' => Storage::url($file->file), |
||
29 | 'title' => '', |
||
30 | 'text' => $file->name, |
||
31 | ]); |
||
32 | } |
||
33 | |||
34 | // Sort the list alphabetically. |
||
35 | usort($resources, function ($a, $b) { |
||
36 | return strcmp($a['text'], $b['text']); |
||
37 | }); |
||
38 | |||
39 | return view('common/resources', [ |
||
|
|||
40 | // Localized strings. |
||
41 | 'resources_template' => $resources_template, |
||
42 | // List of resource downloads. |
||
43 | 'resources' => $resources, |
||
44 | ]); |
||
47 |