Sessions in Larvel

0

I have the management of a store and when I want to see the contents of the car Laravel is asking me to log in, the route was not protected with this validation and I do not know what can happen, this is the view controller for that action

public function Carro(){
      if (Session::has('carrito')) {
        $arreglo =Session::get('carrito');
        $total=0;
        foreach ($arreglo as $key => $value) {
          $total=$arreglo[$key]['attr12']+$total;
        }
        return view('cart',['total'=>$total]);
      }else{
        return view('cart');
      }
    } 
    
asked by Hernando 22.08.2018 в 16:43
source

1 answer

0
  

I found the problem, I had a call from auth in the controller   of the shopping cart

public function __construct()
  {
    $this->middleware('auth');
  }
    
answered by 22.08.2018 в 20:15