Added Document's transaction attachment ( 8669kjrkn )
This commit is contained in:
parent
4a5d698edb
commit
64d07cb001
|
|
@ -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');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue