Passed
Push — master ( 7ae694...04d0ca )
by Jeremy
03:17
created

AdminDetailsController   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 3
c 1
b 0
f 1
dl 0
loc 37
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A listRoutes() 0 8 1
A __construct() 0 3 1
A activeUsers() 0 5 1
1
<?php
2
3
namespace App\Http\Controllers;
4
5
use App\Models\User;
6
use Illuminate\Support\Facades\Route;
7
8
class AdminDetailsController extends Controller
9
{
10
    /**
11
     * Create a new controller instance.
12
     *
13
     * @return void
14
     */
15
    public function __construct()
16
    {
17
        $this->middleware('auth');
18
    }
19
20
    /**
21
     * Display a listing of the resource.
22
     *
23
     * @return \Illuminate\Http\Response
24
     */
25
    public function listRoutes()
26
    {
27
        $routes = Route::getRoutes();
28
        $data = [
29
            'routes' => $routes,
30
        ];
31
32
        return view('pages.admin.route-details', $data);
33
    }
34
35
    /**
36
     * Display active users page.
37
     *
38
     * @return \Illuminate\Http\Response
39
     */
40
    public function activeUsers()
41
    {
42
        $users = User::count();
43
44
        return view('pages.admin.active-users', ['users' => $users]);
0 ignored issues
show
Bug Best Practice introduced by
The expression return view('pages.admin...ray('users' => $users)) returns the type Illuminate\View\View which is incompatible with the documented return type Illuminate\Http\Response.
Loading history...
45
    }
46
}
47