Passed
Push — dev6 ( 530aaf...5da90e )
by Ron
16:07
created

ShowDeletedTipController::__invoke()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 15
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 15
rs 9.9332
cc 1
nc 1
nop 1
1
<?php
2
3
namespace App\Http\Controllers\TechTips;
4
5
use App\Http\Controllers\Controller;
6
use App\Models\TechTip;
7
use Illuminate\Http\Request;
8
use Inertia\Inertia;
9
10
class ShowDeletedTipController extends Controller
11
{
12
    /**
13
     * Show a Tech Tip that has been soft deleted
14
     */
15
    public function __invoke($id)
16
    {
17
        $this->authorize('manage', TechTip::class);
18
19
        //  Pull the Tech Tip Information
20
        $tip = TechTip::where('slug', $id)
21
                ->withTrashed()
22
                ->with('EquipmentType')
23
                ->with('FileUploads')
24
                ->with('TechTipComment.User')
25
                ->firstOrFail()
26
                ->makeHidden(['summary', 'sticky']);
27
28
        return Inertia::render('TechTips/ShowDeleted', [
29
            'tip' => $tip,
30
        ]);
31
    }
32
}
33