| Conditions | 3 |
| Paths | 3 |
| Total Lines | 23 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 20 | public function __invoke($channel = null) |
||
| 21 | { |
||
| 22 | $this->authorize('viewAny', AppSettings::class); |
||
| 23 | |||
| 24 | $props = []; |
||
| 25 | if(!is_null($channel)) |
||
| 26 | { |
||
| 27 | // If the channel name is invalid, return 404 error |
||
| 28 | if(is_null($this->getChannelDetails($channel))) |
||
| 29 | { |
||
| 30 | abort(404, 'Cannot find the specified Log Channel'); |
||
| 31 | } |
||
| 32 | |||
| 33 | $props = [ |
||
| 34 | 'channel' => $channel, |
||
| 35 | 'log_files' => $this->getChannelStats($channel), |
||
| 36 | 'levels' => $this->logLevels, |
||
| 37 | ]; |
||
| 38 | } |
||
| 39 | |||
| 40 | $props['channels'] = Arr::pluck($this->logChannels, 'name'); |
||
| 41 | |||
| 42 | return Inertia::render('Logs/Index', $props); |
||
| 43 | } |
||
| 45 |