ShopLogoutController   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A destroy() 0 9 1
1
<?php
2
namespace Mongi\Mongicommerce\Http\Controllers\auth;
3
4
use Illuminate\Http\Request;
5
use Illuminate\Support\Facades\Auth;
6
use App\Http\Controllers\Auth\AuthenticatedSessionController;
7
8
class ShopLogoutController extends AuthenticatedSessionController
9
{
10
     /**
11
     * Destroy an authenticated session.
12
     *
13
     * @param  \Illuminate\Http\Request  $request
14
     * @return \Illuminate\Http\RedirectResponse
15
     */
16
    public function destroy(Request $request)
17
    {
18
        Auth::guard('web')->logout();
19
20
        $request->session()->invalidate();
21
22
        $request->session()->regenerateToken();
23
        session()->flush();
24
        return redirect(route('shop'));
0 ignored issues
show
Bug Best Practice introduced by
The expression return redirect(route('shop')) also could return the type Illuminate\Routing\Redirector which is incompatible with the documented return type Illuminate\Http\RedirectResponse.
Loading history...
25
    }
26
}
27