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,
        ]);
    }
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,
        ]);
    }
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 , ] ) ; }
Return the purchase pay view.

@return \Illuminate\View\View
Return the purchase pay view .