public function shoppingCart()
    {
        $shoppingCart = $this->orders()->with('details')
            ->where('type', 'cart')
            ->first();

        return is_null($shoppingCart) ? collect() : $shoppingCart->details;
    }
public function shoppingCart()
    {
        $shoppingCart = $this->orders()->with('details')
            ->where('type', 'cart')
            ->first();

        return is_null($shoppingCart) ? collect() : $shoppingCart->details;
    }
public function shoppingCart ( ) { $ shoppingCart = $ this -> orders ( ) -> with ( 'details' ) -> where ( 'type' , 'cart' ) -> first ( ) ; return is_null ( $ shoppingCart ) ? collect ( ) : $ shoppingCart -> details ; }
The user's shopping cart. | while refactoring

@return mixed
The user s shopping cart . | while refactoring