Import notification file and updated other file..

This commit is contained in:
Cüneyt Şentürk
2021-06-19 22:30:14 +03:00
parent 4687185f4a
commit 5c5b890942
12 changed files with 182 additions and 27 deletions

View File

@ -24,8 +24,15 @@ class Import
$file = $request->file('import');
if (should_queue()) {
$rows = $class->toArray($file);
$total_rows = 0;
if (!empty($rows[0])) {
$total_rows = count($rows[0]);
}
$class->queue($file)->onQueue('imports')->chain([
new NotifyUser(user(), new ImportCompleted),
new NotifyUser(user(), new ImportCompleted($translation, $total_rows)),
]);
$message = trans('messages.success.import_queued', ['type' => $translation]);