| Conditions | 4 |
| Paths | 6 |
| Total Lines | 22 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 12 | ||
| Bugs | 1 | Features | 1 |
| 1 | <?php |
||
| 14 | public function index() |
||
| 15 | { |
||
| 16 | |||
| 17 | if (Request::input('l')) { |
||
| 18 | LaravelLogViewer::setFile(base64_decode(Request::input('l'))); |
||
| 19 | } |
||
| 20 | |||
| 21 | if (Request::input('dl')) { |
||
| 22 | return Response::download(LaravelLogViewer::pathToLogFile(base64_decode(Request::input('dl')))); |
||
| 23 | } elseif (Request::has('del')) { |
||
| 24 | File::delete(LaravelLogViewer::pathToLogFile(base64_decode(Request::input('del')))); |
||
| 25 | return Redirect::to(Request::url()); |
||
| 26 | } |
||
| 27 | |||
| 28 | $logs = LaravelLogViewer::all(); |
||
| 29 | |||
| 30 | return View::make('laravel-log-viewer::log', [ |
||
| 31 | 'logs' => $logs, |
||
| 32 | 'files' => LaravelLogViewer::getFiles(true), |
||
| 33 | 'current_file' => LaravelLogViewer::getFileName() |
||
| 34 | ]); |
||
| 35 | } |
||
| 36 | } |
||
| 37 |