ContactMeController   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 25
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A index() 0 3 1
A store() 0 8 1
1
<?php
2
3
namespace App\Http\Controllers;
4
5
use App\Http\Requests\ContactMeStoreRequest;
6
use App\Services\NotificationService;
7
use Illuminate\Http\Request;
8
use Mail;
9
10
class ContactMeController extends Controller
11
{
12
    private NotificationService $notificationService;
13
14
    public function __construct(
15
        NotificationService $notificationService
16
    ) {
17
        $this->notificationService = $notificationService;
18
    }
19
20
    // Show Contact Form
21
    public function index(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

21
    public function index(/** @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...
22
    {
23
        return view('forms.contact');
24
    }
25
26
    // Store Contact Form data
27
    public function store(ContactMeStoreRequest $request)
28
    {
29
        //  Store data in database
30
        //Contact::create($request->all());
31
32
        $this->notificationService->sendEmailContactMe($request->all(), 1);
33
34
        return back()->with('success', 'We have received your message and would like to thank you for writing to us.');
35
        //return redirect('/');
36
    }
37
38
}