some changes..

This commit is contained in:
Cüneyt Şentürk 2021-01-09 23:41:01 +03:00
parent 67fca4d5b9
commit 2455ec5d7e
7 changed files with 40 additions and 24 deletions

View File

@ -17,7 +17,7 @@ abstract class Document extends Component
} }
$alias = config('type.' . $type . '.alias'); $alias = config('type.' . $type . '.alias');
$prefix = config("type.' . $type . '.translation.prefix"); $prefix = config('type.' . $type . '.translation.prefix');
if (!empty($alias)) { if (!empty($alias)) {
$alias .= '::'; $alias .= '::';
@ -92,7 +92,7 @@ abstract class Document extends Component
$alias = config('type.' . $type . '.alias'); $alias = config('type.' . $type . '.alias');
$group = config('type.' . $type . '.group'); $group = config('type.' . $type . '.group');
$prefix = config("type.' . $type . '.permission.prefix"); $prefix = config('type.' . $type . '.permission.prefix');
$permission = $config_key . '-'; $permission = $config_key . '-';

View File

@ -28,7 +28,7 @@ class Document extends FormRequest
{ {
$type = $this->request->get('type', Model::INVOICE_TYPE); $type = $this->request->get('type', Model::INVOICE_TYPE);
$type = config("type.{$type}.route_parameter"); $type = config('type.' . $type . '.route_parameter');
// Check if store or update // Check if store or update
if ($this->getMethod() == 'PATCH') { if ($this->getMethod() == 'PATCH') {

View File

@ -21,11 +21,15 @@ class MarkDocumentCancelled
{ {
$this->dispatch(new CancelDocument($event->document)); $this->dispatch(new CancelDocument($event->document));
$type = trans_choice( $type_text = '';
config("type.{$event->document->type}.alias", '') .
'general.' . config("type.{$event->document->type}.translation_key"), if ($alias = config('type.' . $event->document->type . '.alias', '')) {
1 $type_text .= $alias . '::';
); }
$type_text .= 'general.' . config('type.' . $event->document->type .'.translation.prefix');
$type = trans_choice($type_text, 1);
$this->dispatch( $this->dispatch(
new CreateDocumentHistory( new CreateDocumentHistory(

View File

@ -24,11 +24,15 @@ class MarkDocumentReceived
$event->document->save(); $event->document->save();
} }
$type = trans_choice( $type_text = '';
config("type.{$event->document->type}.alias", '') .
'general.' . config("type.{$event->document->type}.translation_key"), if ($alias = config('type.' . $event->document->type . '.alias', '')) {
1 $type_text .= $alias . '::';
); }
$type_text .= 'general.' . config('type.' . $event->document->type .'.translation.prefix');
$type = trans_choice($type_text, 1);
$this->dispatch( $this->dispatch(
new CreateDocumentHistory( new CreateDocumentHistory(

View File

@ -24,11 +24,15 @@ class MarkDocumentSent
$event->document->save(); $event->document->save();
} }
$type = trans_choice( $type_text = '';
config("type.{$event->document->type}.alias", '') .
'general.' . config("type.{$event->document->type}.translation_key"), if ($alias = config('type.' . $event->document->type . '.alias', '')) {
1 $type_text .= $alias . '::';
); }
$type_text .= 'general.' . config('type.' . $event->document->type .'.translation.prefix');
$type = trans_choice($type_text, 1);
$this->dispatch( $this->dispatch(
new CreateDocumentHistory( new CreateDocumentHistory(

View File

@ -29,11 +29,15 @@ class MarkDocumentViewed
$document->status = 'viewed'; $document->status = 'viewed';
$document->save(); $document->save();
$type = trans_choice( $type_text = '';
config("type.{$event->document->type}.alias", '') .
'general.' . config("type.{$event->document->type}.translation_key"), if ($alias = config('type.' . $event->document->type . '.alias', '')) {
1 $type_text .= $alias . '::';
); }
$type_text .= 'general.' . config('type.' . $event->document->type .'.translation.prefix');
$type = trans_choice($type_text, 1);
$this->dispatch( $this->dispatch(
new CreateDocumentHistory( new CreateDocumentHistory(

View File

@ -16,7 +16,7 @@ class Company extends Component
{ {
$company = user()->companies()->first(); $company = user()->companies()->first();
$inputNameType = config("type.{$this->type}.route_parameter"); $inputNameType = config('type.' . $this->type . '.route.parameter');
return view('components.documents.form.company', compact('company','inputNameType')); return view('components.documents.form.company', compact('company','inputNameType'));
} }