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

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