Store::__invoke()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 2
dl 0
loc 8
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace App\Http\Controllers\Chan;
4
5
use App\Http\Requests\ValidateChanRequest;
6
use App\Models\Chan;
7
use Illuminate\Routing\Controller;
8
9
class Store extends Controller
10
{
11
    public function __invoke(ValidateChanRequest $request, Chan $chan)
12
    {
13
        $chan->fill($request->validated())->save();
14
15
        return [
16
            'message' => __('The chan was successfully created'),
17
            'redirect' => 'chan.edit',
18
            'param' => ['chan' => $chan->id],
19
        ];
20
    }
21
}
22