mirror of
https://github.com/nothingworksinc/ticketbeast.git
synced 2026-01-26 11:14:06 +00:00
48 - Cleaning up a Loose Variable
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user