Added Document's transaction attachment ( 8669kjrkn )

This commit is contained in:
Cüneyt Şentürk 2024-02-19 14:23:08 +03:00
parent 4a5d698edb
commit 64d07cb001
2 changed files with 32 additions and 0 deletions

View File

@ -6,6 +6,8 @@ use App\Abstracts\View\Components\Documents\Show as Component;
class Attachment extends Component
{
public $transaction_attachment;
/**
* Get the view / contents that represent the component.
*
@ -13,6 +15,20 @@ class Attachment extends Component
*/
public function render()
{
$this->transaction_attachment = collect();
if ($this->document->transactions->count()) {
foreach ($this->document->transactions as $transaction) {
if (! $transaction->attachment) {
continue;
}
foreach ($transaction->attachment as $file) {
$this->transaction_attachment->push($file);
}
}
}
return view('components.documents.show.attachment');
}
}

View File

@ -12,6 +12,22 @@
@foreach ($attachment as $file)
<x-media.file :file="$file" />
@endforeach
@if ($transaction_attachment->count())
<div class="relative mt-4">
<div class="absolute inset-0 flex items-center" aria-hidden="true">
<div class="w-full border-t border-gray-300"></div>
</div>
<div class="relative flex justify-center">
<span class="bg-white px-2 text-sm text-gray-500">{{ trans_choice('general.transactions', 1) }}</span>
</div>
</div>
@foreach ($transaction_attachment as $file)
<x-media.file :file="$file" />
@endforeach
@endif
</x-slot>
</x-show.accordion>
@endif