1 | <?php |
||
2 | |||
3 | namespace App\Http\Controllers; |
||
4 | |||
5 | use Auth; |
||
6 | |||
7 | class UserController extends Controller |
||
8 | { |
||
9 | /** |
||
10 | * Create a new controller instance. |
||
11 | * |
||
12 | * @return void |
||
13 | */ |
||
14 | public function __construct() |
||
15 | { |
||
16 | $this->middleware('auth'); |
||
17 | } |
||
18 | |||
19 | /** |
||
20 | * Show the application dashboard. |
||
21 | * |
||
22 | * @return \Illuminate\Http\Response |
||
23 | */ |
||
24 | public function index() |
||
25 | { |
||
26 | $user = Auth::user(); |
||
27 | |||
28 | if ($user->isAdmin()) { |
||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
29 | return view('pages.admin.home'); |
||
30 | } |
||
31 | |||
32 | return view('pages.user.home'); |
||
33 | } |
||
34 | } |
||
35 |