Passed
Push — master ( a4f072...1d8e2a )
by Curtis
06:05
created

Store   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 8 1
1
<?php
2
3
namespace App\Http\Controllers\Personevent;
4
5
use App\PersonEvent;
6
use Illuminate\Routing\Controller;
7
use App\Http\Requests\ValidatePersonEventRequest;
8
9
class Store extends Controller
10
{
11
    public function __invoke(ValidatePersonEventRequest $request, PersonEvent $personEvent)
12
    {
13
        $personEvent->fill($request->validated())->save();
14
15
        return [
16
            'message' => __('The person event was successfully created'),
17
            'redirect' => 'personevent.edit',
18
            'param' => ['personEvent' => $personEvent->id],
19
        ];
20
    }
21
}
22