HomeController.php 780 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. namespace App\Http\Controllers;
  3. use Illuminate\Http\Request;
  4. use Illuminate\Support\Facades\Gate;
  5. class HomeController extends Controller
  6. {
  7. /**
  8. * Create a new controller instance.
  9. *
  10. * @return void
  11. */
  12. public function __construct()
  13. {
  14. $this->middleware('auth');
  15. }
  16. /**
  17. * Show the application dashboard.
  18. *
  19. * @return \Illuminate\Contracts\Support\Renderable
  20. */
  21. public function index()
  22. {
  23. if(!Gate::allows('退货管理-查询')){
  24. if(!Gate::allows('运输管理-查询')){ return view('home');}
  25. return redirect(url('waybill'));
  26. }
  27. return redirect(url('rejected/index/general'));
  28. }
  29. public function home()
  30. {
  31. return view('home');
  32. }
  33. }