original_string: public function getSold()
      {
          $items = Auth::user()->items()
              ->leftJoin('purchases')
              ->where(function ($query) {
                  $query->typeFixed()->whereNotNull('purchases.purchase_id');
              });
  
          // Allows sorting by buyer username
          $items->getBaseQuery()
              ->join('users', 'users.user_id', '=', 'purchases.user_id');
  
          if (mustard_loaded('auctions')) {
              $items->leftJoin('winningBid')
                  ->orWhere(function ($query) {
                      $query->typeAuction()->whereNotNull('bids.bid_id');
                  });
          }
  
          $table = new InventorySold($items);
  
          return view('mustard::inventory.sold', [
              'table' => $table,
              'items' => $table->paginate(),
          ]);
      }
code: public function getSold()
      {
          $items = Auth::user()->items()
              ->leftJoin('purchases')
              ->where(function ($query) {
                  $query->typeFixed()->whereNotNull('purchases.purchase_id');
              });
  
          // Allows sorting by buyer username
          $items->getBaseQuery()
              ->join('users', 'users.user_id', '=', 'purchases.user_id');
  
          if (mustard_loaded('auctions')) {
              $items->leftJoin('winningBid')
                  ->orWhere(function ($query) {
                      $query->typeAuction()->whereNotNull('bids.bid_id');
                  });
          }
  
          $table = new InventorySold($items);
  
          return view('mustard::inventory.sold', [
              'table' => $table,
              'items' => $table->paginate(),
          ]);
      }
code_tokens: public function getSold ( ) { $ items = Auth :: user ( ) -> items ( ) -> leftJoin ( 'purchases' ) -> where ( function ( $ query ) { $ query -> typeFixed ( ) -> whereNotNull ( 'purchases.purchase_id' ) ; } ) ; // Allows sorting by buyer username $ items -> getBaseQuery ( ) -> join ( 'users' , 'users.user_id' , '=' , 'purchases.user_id' ) ; if ( mustard_loaded ( 'auctions' ) ) { $ items -> leftJoin ( 'winningBid' ) -> orWhere ( function ( $ query ) { $ query -> typeAuction ( ) -> whereNotNull ( 'bids.bid_id' ) ; } ) ; } $ table = new InventorySold ( $ items ) ; return view ( 'mustard::inventory.sold' , [ 'table' => $ table , 'items' => $ table -> paginate ( ) , ] ) ; }
docstring: Return the inventory sold items view.
  
  @return \Illuminate\View\View
docstring_tokens: Return the inventory sold items view .