src/lib/Http/Controllers/ItemController.php
public function getBid($itemId)
    {
        $item = Item::findOrFail($itemId);

        if (!$item->auction) {
            return redirect($item->url)->withErrors([
                'This item is not an auction, so cannot be bid on.',
            ]);
        }

        $bids = $item->getBidHistory();

        $highest_bid = $bids->first() ?: new Bid();

        if ($bids->isEmpty()) {
            $minimum_bid = $item->startPrice;
        } elseif ($highest_bid->bidder == Auth::user()) {
            $minimum_bid = BidIncrement::getMinimumNextBid($highest_bid->amount);
        } else {
            $minimum_bid = BidIncrement::getMinimumNextBid($item->biddingPrice);
        }

        return view('mustard::item.bid', [
            'item'        => $item,
            'bids'        => $bids,
            'highest_bid' => $highest_bid,
            'minimum_bid' => $minimum_bid,
        ]);
    }
public function getBid($itemId)
    {
        $item = Item::findOrFail($itemId);

        if (!$item->auction) {
            return redirect($item->url)->withErrors([
                'This item is not an auction, so cannot be bid on.',
            ]);
        }

        $bids = $item->getBidHistory();

        $highest_bid = $bids->first() ?: new Bid();

        if ($bids->isEmpty()) {
            $minimum_bid = $item->startPrice;
        } elseif ($highest_bid->bidder == Auth::user()) {
            $minimum_bid = BidIncrement::getMinimumNextBid($highest_bid->amount);
        } else {
            $minimum_bid = BidIncrement::getMinimumNextBid($item->biddingPrice);
        }

        return view('mustard::item.bid', [
            'item'        => $item,
            'bids'        => $bids,
            'highest_bid' => $highest_bid,
            'minimum_bid' => $minimum_bid,
        ]);
    }
public function getBid ( $ itemId ) { $ item = Item :: findOrFail ( $ itemId ) ; if ( ! $ item -> auction ) { return redirect ( $ item -> url ) -> withErrors ( [ 'This item is not an auction, so cannot be bid on.' , ] ) ; } $ bids = $ item -> getBidHistory ( ) ; $ highest_bid = $ bids -> first ( ) ? : new Bid ( ) ; if ( $ bids -> isEmpty ( ) ) { $ minimum_bid = $ item -> startPrice ; } elseif ( $ highest_bid -> bidder == Auth :: user ( ) ) { $ minimum_bid = BidIncrement :: getMinimumNextBid ( $ highest_bid -> amount ) ; } else { $ minimum_bid = BidIncrement :: getMinimumNextBid ( $ item -> biddingPrice ) ; } return view ( 'mustard::item.bid' , [ 'item' => $ item , 'bids' => $ bids , 'highest_bid' => $ highest_bid , 'minimum_bid' => $ minimum_bid , ] ) ; }
Return the item bid view.

@param int $itemId

@return \Illuminate\View\View
Return the item bid view .