HomeController.php 709 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. namespace App\Http\Controllers;
  3. use Illuminate\Http\Request;
  4. use App\Model\Privillage\Role;
  5. use Auth;
  6. class HomeController extends Controller
  7. {
  8. /**
  9. * Create a new controller instance.
  10. *
  11. * @return void
  12. */
  13. public function __construct()
  14. {
  15. $this->middleware('auth');
  16. }
  17. /**
  18. * Show the application dashboard.
  19. *
  20. * @return \Illuminate\Contracts\Support\Renderable
  21. */
  22. public function index()
  23. {
  24. $getStatus = Role::where('id',Auth::user()->role_id)->value('akses');
  25. if($getStatus == 'administrator'){
  26. return redirect('/program');
  27. }else{
  28. return redirect('/data-viz');
  29. }
  30. }
  31. }