Completed
Push — master ( f02830...61e7f7 )
by Cristian
03:03
created

AdminController   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 5
Bugs 2 Features 1
Metric Value
wmc 3
c 5
b 2
f 1
lcom 1
cbo 1
dl 0
loc 35
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A dashboard() 0 6 1
A redirectToDashboard() 0 4 1
1
<?php
2
3
namespace Backpack\Base\app\Http\Controllers;
4
5
class AdminController extends Controller
6
{
7
    protected $data = []; // the information we send to the view
8
9
    /**
10
     * Create a new controller instance.
11
     */
12
    public function __construct()
13
    {
14
        $this->middleware('auth');
15
    }
16
17
    /**
18
     * Show the admin dashboard.
19
     *
20
     * @return \Illuminate\Http\Response
21
     */
22
    public function dashboard()
23
    {
24
        $this->data['title'] = 'Dashboard'; // set the page title
25
26
        return view('backpack::dashboard', $this->data);
27
    }
28
29
    /**
30
     * Redirect the admin dashboard.
31
     * The '/admin' route is not to be used, because it breaks the menu's active state.
32
     *
33
     * @return \Illuminate\Http\Response
34
     */
35
    public function redirectToDashboard()
36
    {
37
        return redirect('admin/dashboard');
38
    }
39
}
40