mirror of
https://github.com/nothingworksinc/ticketbeast.git
synced 2026-02-10 18:51:45 +00:00
6.8 - Reserving Individual Tickets
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Ticket extends Model
|
||||
@@ -13,6 +14,11 @@ class Ticket extends Model
|
||||
return $query->whereNull('order_id');
|
||||
}
|
||||
|
||||
public function reserve()
|
||||
{
|
||||
$this->update(['reserved_at' => Carbon::now()]);
|
||||
}
|
||||
|
||||
public function release()
|
||||
{
|
||||
$this->update(['order_id' => null]);
|
||||
|
||||
Reference in New Issue
Block a user