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

AdminController::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
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