30 lines
438 B
PHP
30 lines
438 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use Illuminate\Support\Facades\Auth;
|
|
|
|
class UserHomeController extends Controller
|
|
{
|
|
public function __construct()
|
|
{
|
|
$this->middleware('auth');
|
|
}
|
|
|
|
public function home()
|
|
{
|
|
switch (Auth::user()->role()) {
|
|
case 'Customer':
|
|
return View('home');
|
|
|
|
case 'Reseller':
|
|
break;
|
|
|
|
case 'Wholesaler':
|
|
break;
|
|
|
|
default:
|
|
abort(500,'Unknown role: ',Auth::user()->role());
|
|
}
|
|
}
|
|
} |