GetATreatmentController::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 4
ccs 0
cts 1
cp 0
crap 2
rs 10
1
<?php
2
3
namespace App\Http\Controllers;
4
5
use App\Http\Requests\GetATreatmentStoreRequest;
6
use App\Services\NotificationService;
7
use Illuminate\Http\Request;
8
9
class GetATreatmentController extends Controller
10
{
11
    private NotificationService $notificationService;
12
13
    public function __construct(
14
        NotificationService $notificationService
15
    ) {
16
        $this->notificationService = $notificationService;
17
    }
18
19
    // Show Contact Form
20
    public function create(Request $request)
0 ignored issues
show
Unused Code introduced by
The parameter $request is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

20
    public function create(/** @scrutinizer ignore-unused */ Request $request)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
21
    {
22
        return view('forms.getATreatment');
23
    }
24
25
    // Store Contact Form data
26
    public function store(GetATreatmentStoreRequest $request)
27
    {
28
        //dd($request->all());
29
        //  Store data in database
30
        //Contact::create($request->all());
31
32
        $this->notificationService->sendEmailGetATreatment($request->all(), 1);
33
34
        return back()->with('success', 'Thank you for your treatment request, I will contact you soon.');
35
    }
36
}
37