6.8 - Reserving Individual Tickets

This commit is contained in:
Adam Wathan
2016-11-20 18:50:04 -05:00
parent 2b21f07aa2
commit c3c80722f5
6 changed files with 45 additions and 0 deletions

View File

@@ -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]);