Files
investbrain/resources/views/holding/holding-dividends-list.blade.php
T

41 lines
1002 B
PHP
Raw Normal View History

2024-08-30 20:58:00 -05:00
<?php
use App\Models\Holding;
use Livewire\Volt\Component;
2025-03-10 21:17:24 -05:00
new class extends Component
{
2024-08-30 20:58:00 -05:00
// props
public Holding $holding;
protected $listeners = [
'transaction-updated' => '$refresh',
2025-03-10 21:17:24 -05:00
'transaction-saved' => '$refresh',
2024-08-30 20:58:00 -05:00
];
2025-03-10 21:17:24 -05:00
2024-08-30 20:58:00 -05:00
// methods
}; ?>
<div>
@foreach ($holding->dividends->take(5) as $dividend)
2025-09-28 19:54:49 -05:00
<x-ui.list-item :item="$dividend" no-separator no-hover>
2024-08-30 20:58:00 -05:00
<x-slot:value>
@php
$owned = ($dividend->purchased - $dividend->sold);
@endphp
2025-04-09 19:25:15 -05:00
{{ Number::currency($dividend->dividend_amount, $holding->market_data->currency) }}
2024-08-30 20:58:00 -05:00
x {{ $owned }}
2025-04-09 19:25:15 -05:00
= {{ Number::currency($owned * $dividend->dividend_amount, $holding->market_data->currency) }}
2024-08-30 20:58:00 -05:00
</x-slot:value>
<x-slot:sub-value>
2024-09-05 20:41:07 -05:00
<span title="{{ __('Ex Dividend Date') }}">{{ $dividend->date->format('F d, Y') }}</span>
2024-08-30 20:58:00 -05:00
</x-slot:sub-value>
</x-ui.list-item>
2024-08-30 20:58:00 -05:00
@endforeach
</div>