mirror of
https://github.com/nothingworksinc/ticketbeast.git
synced 2026-01-26 11:14:06 +00:00
136 - Refactoring for Robustness
This commit is contained in:
@@ -13,8 +13,15 @@ class AttendeeMessage extends Model
|
||||
return $this->belongsTo(Concert::class);
|
||||
}
|
||||
|
||||
public function recipients()
|
||||
public function orders()
|
||||
{
|
||||
return $this->concert->orders()->pluck('email');
|
||||
return $this->concert->orders();
|
||||
}
|
||||
|
||||
public function withChunkedRecipients($chunkSize, $callback)
|
||||
{
|
||||
$this->orders()->chunk($chunkSize, function ($orders) use ($callback) {
|
||||
$callback($orders->pluck('email'));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user