mirror of
https://github.com/nothingworksinc/ticketbeast.git
synced 2026-01-26 11:14:06 +00:00
3.5 - Cancelling Failed Orders
This commit is contained in:
@@ -12,4 +12,13 @@ class Order extends Model
|
||||
{
|
||||
return $this->hasMany(Ticket::class);
|
||||
}
|
||||
|
||||
public function cancel()
|
||||
{
|
||||
foreach ($this->tickets as $ticket) {
|
||||
$ticket->update(['order_id' => null]);
|
||||
}
|
||||
|
||||
$this->delete();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user