app/Http/Controllers/HomeController.php
/**
     * Show the application dashboard.
     *
     * @return \Illuminate\Contracts\Support\Renderable
     */
Show the application dashboard.
@return \Illuminate\Contracts\Support\Renderable
Show the application dashboard . @return \ Illuminate \ Contracts \ Support \ Renderable
public function index()
    {
        $user = User::find(Auth::user()->id);
        if ($user->hasRole('SuperAdministrador')) {
            return redirect()->route('empresa.index');
        } elseif ($user->hasRole('Administrador') || $user->hasRole('JefeVentas')) {
            return redirect()->route('empresa.show', $user->empresa_id);
        } elseif ($user->hasRole('Vendedor')) {
            return redirect('e/visitas/vendedor/' . $user->id);
        }
        dd('No rol');
    }
public function index ( ) { $ user = User :: find ( Auth :: user ( ) -> id ) ; if ( $ user -> hasRole ( 'SuperAdministrador' ) ) { return redirect ( ) -> route ( 'empresa.index' ) ; } elseif ( $ user -> hasRole ( 'Administrador' ) || $ user -> hasRole ( 'JefeVentas' ) ) { return redirect ( ) -> route ( 'empresa.show' , $ user -> empresa_id ) ; } elseif ( $ user -> hasRole ( 'Vendedor' ) ) { return redirect ( 'e/visitas/vendedor/' . $ user -> id ) ; } dd ( 'No rol' ) ; }
Show the application dashboard.
Show the application dashboard .