original_string: public function getDetails($purchaseId) {
          $purchase = Purchase::findOrFail($purchaseId);
  
          if (!in_array(Auth::user()->userId, [
              $purchase->item->seller->userId,
              $purchase->buyer->userId
          ])) {
              return redirect('/inventory')->withErrors([
                  "You are not the buyer or seller of this item."
              ]);
          }
  
          return view('mustard::purchase.details', [
              'purchase' => $purchase,
          ]);
      }
code: public function getDetails($purchaseId) {
          $purchase = Purchase::findOrFail($purchaseId);
  
          if (!in_array(Auth::user()->userId, [
              $purchase->item->seller->userId,
              $purchase->buyer->userId
          ])) {
              return redirect('/inventory')->withErrors([
                  "You are not the buyer or seller of this item."
              ]);
          }
  
          return view('mustard::purchase.details', [
              'purchase' => $purchase,
          ]);
      }
code_tokens: public function getDetails ( $ purchaseId ) { $ purchase = Purchase :: findOrFail ( $ purchaseId ) ; if ( ! in_array ( Auth :: user ( ) -> userId , [ $ purchase -> item -> seller -> userId , $ purchase -> buyer -> userId ] ) ) { return redirect ( '/inventory' ) -> withErrors ( [ "You are not the buyer or seller of this item." ] ) ; } return view ( 'mustard::purchase.details' , [ 'purchase' => $ purchase , ] ) ; }
docstring: Return the purchase details view.
  
  @return \Illuminate\View\View
docstring_tokens: Return the purchase details view .