Add Document/Transaction/Contact types to the config

This commit is contained in:
Burak Çakırel
2021-01-05 23:22:38 +03:00
parent 1deff6e5b4
commit 3aa94bc9e2
14 changed files with 130 additions and 147 deletions

View File

@@ -21,6 +21,18 @@ class MarkDocumentCancelled
{
$this->dispatch(new CancelDocument($event->document));
$this->dispatch(new CreateDocumentHistory($event->document, 0, trans('documents.messages.marked_cancelled', ['type' => ''])));
$type = trans_choice(
config("type.{$event->document->type}.alias", '') .
'general.' . config("type.{$event->document->type}.translation_key"),
1
);
$this->dispatch(
new CreateDocumentHistory(
$event->document,
0,
trans('documents.messages.marked_cancelled', ['type' => $type])
)
);
}
}

View File

@@ -24,6 +24,18 @@ class MarkDocumentReceived
$event->document->save();
}
$this->dispatch(new CreateDocumentHistory($event->document, 0, trans('documents.messages.marked_received', ['type' => ''])));
$type = trans_choice(
config("type.{$event->document->type}.alias", '') .
'general.' . config("type.{$event->document->type}.translation_key"),
1
);
$this->dispatch(
new CreateDocumentHistory(
$event->document,
0,
trans('documents.messages.marked_received', ['type' => $type])
)
);
}
}

View File

@@ -24,6 +24,18 @@ class MarkDocumentSent
$event->document->save();
}
$this->dispatch(new CreateDocumentHistory($event->document, 0, trans('documents.messages.marked_sent', ['type' => ''])));
$type = trans_choice(
config("type.{$event->document->type}.alias", '') .
'general.' . config("type.{$event->document->type}.translation_key"),
1
);
$this->dispatch(
new CreateDocumentHistory(
$event->document,
0,
trans('documents.messages.marked_sent', ['type' => $type])
)
);
}
}

View File

@@ -29,6 +29,18 @@ class MarkDocumentViewed
$document->status = 'viewed';
$document->save();
$this->dispatch(new CreateDocumentHistory($event->document, 0, trans('documents.messages.marked_viewed', ['type' => ''])));
$type = trans_choice(
config("type.{$event->document->type}.alias", '') .
'general.' . config("type.{$event->document->type}.translation_key"),
1
);
$this->dispatch(
new CreateDocumentHistory(
$event->document,
0,
trans('documents.messages.marked_viewed', ['type' => $type])
)
);
}
}