mirror of
https://github.com/nothingworksinc/ticketbeast.git
synced 2026-02-05 05:49:05 +00:00
3.7 - Cleaning Up Our Tests
This commit is contained in:
@@ -35,6 +35,16 @@ class Concert extends Model
|
||||
return $this->hasMany(Order::class);
|
||||
}
|
||||
|
||||
public function hasOrderFor($customerEmail)
|
||||
{
|
||||
return $this->orders()->where('email', $customerEmail)->count() > 0;
|
||||
}
|
||||
|
||||
public function ordersFor($customerEmail)
|
||||
{
|
||||
return $this->orders()->where('email', $customerEmail)->get();
|
||||
}
|
||||
|
||||
public function tickets()
|
||||
{
|
||||
return $this->hasMany(Ticket::class);
|
||||
@@ -62,6 +72,8 @@ class Concert extends Model
|
||||
foreach (range(1, $quantity) as $i) {
|
||||
$this->tickets()->create([]);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function ticketsRemaining()
|
||||
|
||||
Reference in New Issue
Block a user