2018-05-20 12:53:14 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
|
2018-07-13 04:53:44 +00:00
|
|
|
use Illuminate\Support\Facades\Auth;
|
|
|
|
|
2018-05-20 12:53:14 +00:00
|
|
|
class UserHomeController extends Controller
|
|
|
|
{
|
|
|
|
public function __construct()
|
|
|
|
{
|
|
|
|
$this->middleware('auth');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function home()
|
|
|
|
{
|
2018-07-13 04:53:44 +00:00
|
|
|
switch (Auth::user()->role()) {
|
|
|
|
case 'Customer':
|
|
|
|
return View('home');
|
|
|
|
|
|
|
|
case 'Reseller':
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'Wholesaler':
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
abort(500,'Unknown role: ',Auth::user()->role());
|
|
|
|
}
|
2018-05-20 12:53:14 +00:00
|
|
|
}
|
|
|
|
}
|