mirror of
https://github.com/nothingworksinc/ticketbeast.git
synced 2026-01-26 11:14:06 +00:00
5.4 - Extracting a Named Constructor
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Order;
|
||||
use App\Concert;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Billing\PaymentGateway;
|
||||
@@ -36,7 +37,7 @@ class ConcertOrdersController extends Controller
|
||||
$this->paymentGateway->charge(request('ticket_quantity') * $concert->ticket_price, request('payment_token'));
|
||||
|
||||
// Create an order for those tickets
|
||||
$order = $concert->createOrder(request('email'), $tickets);
|
||||
$order = Order::forTickets($tickets, request('email'));
|
||||
|
||||
return response()->json($order, 201);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user