mirror of
https://github.com/nothingworksinc/ticketbeast.git
synced 2026-01-26 11:14:06 +00:00
127 - Calculating Tickets Sold
This commit is contained in:
@@ -15,6 +15,11 @@ class Ticket extends Model
|
||||
return $query->whereNull('order_id')->whereNull('reserved_at');
|
||||
}
|
||||
|
||||
public function scopeSold($query)
|
||||
{
|
||||
return $query->whereNotNull('order_id');
|
||||
}
|
||||
|
||||
public function reserve()
|
||||
{
|
||||
$this->update(['reserved_at' => Carbon::now()]);
|
||||
|
||||
Reference in New Issue
Block a user