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

Store::__invoke()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 5
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 8
rs 10
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