public $data;
+ private $broadcast;
+
/**
* Create a new event instance.
{
$tags = Arr::get($webhookData, 'event-data.tags');
+ $broadcast = in_array(env('APP_ENV'), $tags, true);
+
+
/** @todo check webhook key */
$this->batch_id = Str::after(Arr::first($tags, function($tag) {
return new PrivateChannel('emailBatch.'.$this->batch_id);
}
+ public function broadcastWhen()
+ {
+ return $this->broadcast;
+ }
+
/**
* The event's broadcast name.
*/
'subject' => $this->batch->subject,
'recipient-variables' => $variables,
'html' => $view,
- 'o:tag' => [$this->batch->getTag(), 'psq'],
+ 'o:tag' => [$this->batch->getTag(), 'psq', env('APP_ENV')],
'o:testmode' => env('MAILGUN_TEST_MODE', 'yes'),
];
*/
protected function gate()
{
- Gate::define('viewHorizon', function ($user) {
+ Gate::define('viewHorizon', function ($user = null) {
return true;
});
}