Files
investbrain/resources/views/holding/holding-dividends-list.blade.php
T
2025-09-28 19:54:49 -05:00

41 lines
1002 B
PHP

<?php
use App\Models\Holding;
use Livewire\Volt\Component;
new class extends Component
{
// props
public Holding $holding;
protected $listeners = [
'transaction-updated' => '$refresh',
'transaction-saved' => '$refresh',
];
// methods
}; ?>
<div>
@foreach ($holding->dividends->take(5) as $dividend)
<x-ui.list-item :item="$dividend" no-separator no-hover>
<x-slot:value>
@php
$owned = ($dividend->purchased - $dividend->sold);
@endphp
{{ Number::currency($dividend->dividend_amount, $holding->market_data->currency) }}
x {{ $owned }}
= {{ Number::currency($owned * $dividend->dividend_amount, $holding->market_data->currency) }}
</x-slot:value>
<x-slot:sub-value>
<span title="{{ __('Ex Dividend Date') }}">{{ $dividend->date->format('F d, Y') }}</span>
</x-slot:sub-value>
</x-ui.list-item>
@endforeach
</div>