Test Failed
Push — dev6 ( bf43a6...5a7ea5 )
by Ron
16:37
created

ViewLogController   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 11
c 1
b 0
f 0
dl 0
loc 20
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 13 1
1
<?php
2
3
namespace App\Http\Controllers\Admin\Logs;
4
5
use App\Http\Controllers\Controller;
6
use App\Models\AppSettings;
7
use App\Traits\LogUtilitiesTrait;
8
use Illuminate\Http\Request;
9
use Inertia\Inertia;
10
11
class ViewLogController extends Controller
12
{
13
    use LogUtilitiesTrait;
14
15
    /**
16
     * Show the log file
17
     */
18
    public function __invoke($channel, $filename)
19
    {
20
        $this->authorize('viewAny', AppSettings::class);
21
22
        $channel = $this->getChannelDetails($channel);
23
        $fileArr = $this->getFileToArray($filename, $channel);
24
25
        return Inertia::render('Logs/Show', [
26
            'levels'   => $this->logLevels,
27
            'channel'  => $channel,
28
            'filename' => $filename,
29
            'stats'    => [$this->getFileStats($fileArr, $filename)],
30
            'log_file' => $this->parseFile($fileArr),
31
        ]);
32
    }
33
}
34