Skip to content

Commit 6b1cc91

Browse files
committed
adds notifiables ability to export
1 parent 72658cc commit 6b1cc91

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Models/Export.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,11 @@ private static function syncExcel(SyncExcel $exporter): self
154154
'total' => 0,
155155
]);
156156

157-
$export->createdBy->notify((new ExportStarted($export->name))
157+
$notifiables = method_exists($exporter, 'notifiables')
158+
? $exporter->notifiables($export)
159+
: Collection::wrap($export->createdBy);
160+
161+
$notifiables->each->notify((new ExportStarted($export->name))
158162
->onQueue('notifications'));
159163

160164
$count = Collection::wrap($exporter->sheets())
@@ -182,7 +186,7 @@ private static function syncExcel(SyncExcel $exporter): self
182186
? $exporter->emailSubject($export)
183187
: __(':name export done', ['name' => $export->name]);
184188

185-
$export->createdBy->notify((new ExportDone($export, $subject))
189+
$notifiables->each->notify((new ExportDone($export, $subject))
186190
->onQueue('notifications'));
187191

188192
return $export;

0 commit comments

Comments
 (0)