| Conditions | 1 |
| Paths | 1 |
| Total Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 1 |
| Changes | 0 | ||
| 1 | <?php |
||
| 26 | 1 | private function toFile(array $translations): string |
|
| 27 | { |
||
| 28 | 1 | $path = base_path('storage/app/translations'); |
|
| 29 | 1 | File::makeDirectory($path, 0777, true, true); |
|
| 30 | |||
| 31 | 1 | $date = Carbon::now('Europe/Madrid')->format('dmY_His'); |
|
| 32 | 1 | $path = storage_path('app/translations/'.$date.'_excel.xlsx'); |
|
| 33 | |||
| 34 | return (new FastExcel(new SheetCollection($translations)))->export($path, function ($sheets) { |
||
| 35 | return [ |
||
| 36 | 1 | 'key1' => 'mage', |
|
| 37 | 1 | 'key2' => $sheets['key'], |
|
| 38 | 1 | 'value' => $sheets['value'], |
|
| 39 | ]; |
||
| 40 | 1 | }); |
|
| 41 | } |
||
| 42 | } |
||
| 43 |