original_string: public function getPay($purchaseId)
      {
          $purchase = Purchase::findOrFail($purchaseId);
  
          if ($purchase->buyer->userId != Auth::user()->userId) {
              return redirect('/inventory/bought')->withErrors([
                  "You are not the buyer of this item."
              ]);
          }
  
          if ($purchase->isPaid()) {
              return redirect('/inventory/bought')->withStatus(
                  'You have already successfully paid for this item.'
              );
          }
  
          return view('mustard::purchase.pay', [
              'purchase' => $purchase,
          ]);
      }
code: public function getPay($purchaseId)
      {
          $purchase = Purchase::findOrFail($purchaseId);
  
          if ($purchase->buyer->userId != Auth::user()->userId) {
              return redirect('/inventory/bought')->withErrors([
                  "You are not the buyer of this item."
              ]);
          }
  
          if ($purchase->isPaid()) {
              return redirect('/inventory/bought')->withStatus(
                  'You have already successfully paid for this item.'
              );
          }
  
          return view('mustard::purchase.pay', [
              'purchase' => $purchase,
          ]);
      }
code_tokens: public function getPay ( $ purchaseId ) { $ purchase = Purchase :: findOrFail ( $ purchaseId ) ; if ( $ purchase -> buyer -> userId != Auth :: user ( ) -> userId ) { return redirect ( '/inventory/bought' ) -> withErrors ( [ "You are not the buyer of this item." ] ) ; } if ( $ purchase -> isPaid ( ) ) { return redirect ( '/inventory/bought' ) -> withStatus ( 'You have already successfully paid for this item.' ) ; } return view ( 'mustard::purchase.pay' , [ 'purchase' => $ purchase , ] ) ; }
docstring: Return the purchase pay view.
  
  @return \Illuminate\View\View
docstring_tokens: Return the purchase pay view .