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

ShowDeletedTipController   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 15 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