EnableUserController   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A store() 0 10 1
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