@php $totalitems = 0; if(Session::has('cart')){ $cart = \Session::get('cart'); foreach($cart as $item){ $totalitems ++; } } @endphp