48 - Cleaning up a Loose Variable

This commit is contained in:
Adam Wathan
2016-12-14 20:32:25 -05:00
parent 29910e02c9
commit 2ab35a2f14
5 changed files with 26 additions and 6 deletions

View File

@@ -31,14 +31,13 @@ class ConcertOrdersController extends Controller
try {
// Find some tickets
$tickets = $concert->reserveTickets(request('ticket_quantity'));
$reservation = new Reservation($tickets);
$reservation = $concert->reserveTickets(request('ticket_quantity'));
// Charge the customer for the tickets
$this->paymentGateway->charge($reservation->totalCost(), request('payment_token'));
// Create an order for those tickets
$order = Order::forTickets($tickets, request('email'), $reservation->totalCost());
$order = Order::forTickets($reservation->tickets(), request('email'), $reservation->totalCost());
return response()->json($order, 201);