EnableUserController::store()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 5
nc 1
nop 2
dl 0
loc 10
c 0
b 0
f 0
cc 1
rs 10
1
<?php
2
3
namespace Thinktomorrow\Chief\App\Http\Controllers\Back\Users;
4
5
use Illuminate\Http\Request;
6
use Thinktomorrow\Chief\Admin\Users\Application\EnableUser;
7
use Thinktomorrow\Chief\Admin\Users\User;
8
use Thinktomorrow\Chief\App\Http\Controllers\Controller;
9
10
class EnableUserController extends Controller
11
{
12
    public function store(Request $request, $id)
13
    {
14
        $this->authorize('disable-user');
15
16
        $user = User::findOrFail($id);
17
18
        app(EnableUser::class)->handle($user);
19
20
        return redirect()->route('chief.back.users.index')
21
            ->with('messages.success', 'De gebruikersaccount is opnieuw toegang verleend.');
22
    }
23
}
24