DashboardController.php 813 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace App\Http\Controllers;
  3. class DashboardController extends Controller
  4. {
  5. public function index() {
  6. // dd($this->getMenu());
  7. // dump(session('user.SortMenu'));
  8. // dump(session('GateToken'));
  9. // $erpThemes = preg_replace('/\s+/', '', explode(',', env('ERP_THEMES')));
  10. //
  11. // if ($erpThemes[0]) {
  12. // return view("erp.{$erpThemes[0]}.resources.views.dashboard");
  13. // }
  14. $sortMenu = session('user.SortMenu');
  15. if (empty($sortMenu['C7'])) {
  16. return view('pages.generic_dash');
  17. }
  18. $component = explode('::', $sortMenu['C7']);
  19. if (count($component) === 1) {
  20. return view('pages.' . $sortMenu['C7']);
  21. }
  22. return redirect()->route("themes.$component[0].dashboard");
  23. }
  24. }