public function getCollectionAddress($purchaseId)
    {
        $purchase = Purchase::findOrFail($purchaseId);

        if ($purchase->item->seller->userId != Auth::user()->userId) {
            return redirect('/inventory/sold')->withErrors([
                "You are not the seller of this item."
            ]);
        }

        if ($purchase->deliveryOption) {
            return redirect('/inventory/sold')->withErrors([
                "This item is not due to be collected."
            ]);
        }

        if ($purchase->hasAddress()) {
            return redirect('/inventory/sold')->withErrors([
                "You have already provided a collection address for this item."
            ]);
        }

        return view('mustard::purchase.collection-address', [
            'countries' => Iso3166::all(),
            'purchase' => $purchase,
        ]);
    }
public function getCollectionAddress($purchaseId)
    {
        $purchase = Purchase::findOrFail($purchaseId);

        if ($purchase->item->seller->userId != Auth::user()->userId) {
            return redirect('/inventory/sold')->withErrors([
                "You are not the seller of this item."
            ]);
        }

        if ($purchase->deliveryOption) {
            return redirect('/inventory/sold')->withErrors([
                "This item is not due to be collected."
            ]);
        }

        if ($purchase->hasAddress()) {
            return redirect('/inventory/sold')->withErrors([
                "You have already provided a collection address for this item."
            ]);
        }

        return view('mustard::purchase.collection-address', [
            'countries' => Iso3166::all(),
            'purchase' => $purchase,
        ]);
    }
public function getCollectionAddress ( $ purchaseId ) { $ purchase = Purchase :: findOrFail ( $ purchaseId ) ; if ( $ purchase -> item -> seller -> userId != Auth :: user ( ) -> userId ) { return redirect ( '/inventory/sold' ) -> withErrors ( [ "You are not the seller of this item." ] ) ; } if ( $ purchase -> deliveryOption ) { return redirect ( '/inventory/sold' ) -> withErrors ( [ "This item is not due to be collected." ] ) ; } if ( $ purchase -> hasAddress ( ) ) { return redirect ( '/inventory/sold' ) -> withErrors ( [ "You have already provided a collection address for this item." ] ) ; } return view ( 'mustard::purchase.collection-address' , [ 'countries' => Iso3166 :: all ( ) , 'purchase' => $ purchase , ] ) ; }
Return the purchase collection address view.

@return \Illuminate\View\View
Return the purchase collection address view .