mirror of
https://github.com/nothingworksinc/ticketbeast.git
synced 2026-01-26 11:14:06 +00:00
2.10 - Preventing Ticket Sales to Unpublished Concerts
This commit is contained in:
@@ -18,6 +18,8 @@ class ConcertOrdersController extends Controller
|
||||
|
||||
public function store($concertId)
|
||||
{
|
||||
$concert = Concert::published()->findOrFail($concertId);
|
||||
|
||||
$this->validate(request(), [
|
||||
'email' => ['required', 'email'],
|
||||
'ticket_quantity' => ['required', 'integer', 'min:1'],
|
||||
@@ -25,7 +27,6 @@ class ConcertOrdersController extends Controller
|
||||
]);
|
||||
|
||||
try {
|
||||
$concert = Concert::find($concertId);
|
||||
$this->paymentGateway->charge(request('ticket_quantity') * $concert->ticket_price, request('payment_token'));
|
||||
$order = $concert->orderTickets(request('email'), request('ticket_quantity'));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user