mirror of
https://github.com/nothingworksinc/ticketbeast.git
synced 2026-01-26 11:14:06 +00:00
5.1 - Persisting the Order Amount
This commit is contained in:
@@ -58,7 +58,10 @@ class Concert extends Model
|
||||
throw new NotEnoughTicketsException;
|
||||
}
|
||||
|
||||
$order = $this->orders()->create(['email' => $email]);
|
||||
$order = $this->orders()->create([
|
||||
'email' => $email,
|
||||
'amount' => $ticketQuantity * $this->ticket_price,
|
||||
]);
|
||||
|
||||
foreach ($tickets as $ticket) {
|
||||
$order->tickets()->save($ticket);
|
||||
|
||||
Reference in New Issue
Block a user