mirror of
https://github.com/nothingworksinc/ticketbeast.git
synced 2026-02-05 12:49:12 +00:00
5.5 - Precomputing the Order Amount
This commit is contained in:
@@ -8,11 +8,11 @@ class Order extends Model
|
||||
{
|
||||
protected $guarded = [];
|
||||
|
||||
public static function forTickets($tickets, $email)
|
||||
public static function forTickets($tickets, $email, $amount)
|
||||
{
|
||||
$order = self::create([
|
||||
'email' => $email,
|
||||
'amount' => $tickets->sum('price'),
|
||||
'amount' => $amount,
|
||||
]);
|
||||
|
||||
foreach ($tickets as $ticket) {
|
||||
|
||||
Reference in New Issue
Block a user