Files
investbrain/resources/views/holding/show.blade.php
T

168 lines
5.5 KiB
PHP
Raw Normal View History

2024-08-26 19:52:46 -05:00
<x-app-layout>
2024-08-27 21:17:54 -05:00
<div x-data>
2024-10-22 16:48:53 -05:00
<x-ib-alpine-modal
2024-10-18 14:59:10 -05:00
key="create-transaction"
2024-10-22 12:41:18 -05:00
title="{{ __('Create Transaction') }}"
2024-08-27 21:17:54 -05:00
>
@livewire('manage-transaction-form', [
'portfolio' => $portfolio,
2024-08-28 22:06:47 -05:00
'symbol' => $holding->market_data->symbol,
2024-08-27 21:17:54 -05:00
])
2024-10-22 16:48:53 -05:00
</x-ib-alpine-modal>
2024-08-26 19:52:46 -05:00
2024-10-22 16:48:53 -05:00
<x-ib-alpine-modal
key="holding-options"
2024-10-22 12:41:18 -05:00
title="{{ __('Holding Options') }}"
>
@livewire('holding-options-form', [
'holding' => $holding
])
2024-10-22 16:48:53 -05:00
</x-ib-alpine-modal>
2024-08-26 21:34:13 -05:00
<x-ib-toolbar>
<x-slot:title>
<a href="{{ route('portfolio.show', ['portfolio' => $portfolio->id]) }}" title="{{ __('Portfolio') }}">
{{ $portfolio->title }}
2024-08-28 22:06:47 -05:00
</a> » <span title="{{ __('Holding') }}">{{ $holding->market_data->symbol }}</span>
2024-08-26 21:34:13 -05:00
</x-slot:title>
2024-08-27 21:17:54 -05:00
2024-10-21 22:23:20 -05:00
@can('fullAccess', $portfolio)
<x-button
title="{{ __('Holding options') }}"
icon="o-pencil"
class="btn-circle btn-ghost btn-sm text-secondary"
@click="$dispatch('toggle-holding-options')"
/>
2024-10-21 22:23:20 -05:00
@endcan
2024-08-27 21:17:54 -05:00
<x-ib-flex-spacer />
2024-10-21 22:23:20 -05:00
@can('fullAccess', $portfolio)
<x-button
2024-10-22 12:36:43 -05:00
label="{{ __('Create transaction') }}"
2024-10-21 22:23:20 -05:00
class="btn-sm btn-primary whitespace-nowrap"
@click="$dispatch('toggle-create-transaction')"
/>
@endcan
2024-08-26 21:34:13 -05:00
</x-ib-toolbar>
2024-08-26 19:52:46 -05:00
2024-08-26 21:34:13 -05:00
<div class="mt-6 grid md:grid-cols-9 gap-5">
<x-ib-card class="md:col-span-5">
2024-10-18 20:46:22 -05:00
<x-slot:title>
2024-08-26 21:34:13 -05:00
2024-08-28 22:06:47 -05:00
{{ $holding->market_data->symbol }}
2024-10-18 20:46:22 -05:00
<span class="text-sm ml-2"> {{ $holding->market_data->name }} </span>
2024-08-26 21:34:13 -05:00
</x-slot:title>
2024-08-30 20:58:00 -05:00
@livewire('holding-market-data', ['holding' => $holding])
2024-08-27 22:41:13 -05:00
</x-ib-card>
<x-ib-card title="{{ __('Fundamentals') }}" class="md:col-span-4">
2024-09-01 16:06:29 -05:00
<p>
<span class="font-bold">{{ __('Market Cap') }}: </span>
${{ Number::forHumans($holding->market_data->market_cap ?? 0) }}
</p>
2024-08-27 18:12:51 -05:00
<p>
<span class="font-bold">{{ __('Forward PE') }}: </span>
2024-08-28 22:06:47 -05:00
{{ $holding->market_data->forward_pe }}
2024-08-27 18:12:51 -05:00
</p>
<p>
<span class="font-bold">{{ __('Trailing PE') }}: </span>
2024-08-28 22:06:47 -05:00
{{ $holding->market_data->trailing_pe }}
2024-08-27 18:12:51 -05:00
</p>
<p>
2024-09-01 16:06:29 -05:00
<span class="font-bold">{{ __('Book Value') }}: </span>
{{ $holding->market_data->book_value }}
2024-08-27 18:12:51 -05:00
</p>
2024-08-26 21:34:13 -05:00
2024-08-27 22:49:01 -05:00
<p>
<span class="font-bold">{{ __('52 week') }}: </span>
<x-fifty-two-week-range
2024-08-28 22:06:47 -05:00
:low="$holding->market_data->fifty_two_week_low"
:high="$holding->market_data->fifty_two_week_high"
:current="$holding->market_data->market_value"
2024-08-27 22:49:01 -05:00
/>
2024-09-01 16:06:29 -05:00
</p>
<p>
<span class="font-bold">{{ __('Dividend Yield') }}: </span>
2024-09-05 20:23:41 -05:00
{{ Number::percentage(
$holding->market_data->dividend_yield ?? 0,
$holding->market_data->dividend_yield < 1 ? 2 : 0
) }}
2024-09-01 16:06:29 -05:00
</p>
<p>
2024-09-05 20:41:07 -05:00
<span class="font-bold">{{ __('Last Dividend Paid') }}: </span>
{{ $holding->market_data?->last_dividend_date?->format('F d, Y') ?? '' }}
2024-08-27 22:49:01 -05:00
</p>
2024-08-26 21:34:13 -05:00
</x-ib-card>
<x-ib-card title="{{ __('Recent activity') }}" class="md:col-span-3">
2024-08-27 18:12:51 -05:00
@livewire('transactions-list', [
'portfolio' => $holding->portfolio,
2024-08-29 18:46:21 -05:00
'transactions' => $holding->transactions,
2024-08-27 21:17:54 -05:00
'shouldGoToHolding' => false
2024-08-27 18:12:51 -05:00
])
2024-08-26 21:34:13 -05:00
</x-ib-card>
<x-ib-card title="{{ __('Dividends') }}" class="md:col-span-3">
2024-10-18 14:59:10 -05:00
2024-09-06 23:15:43 -05:00
@if($holding->dividends->isEmpty())
<div class="flex justify-center items-center h-full pb-10 text-secondary">
{{ __('No dividends for :symbol yet', ['symbol' => $holding->symbol]) }}
</div>
@endif
2024-08-30 20:58:00 -05:00
@livewire('holding-dividends-list', ['holding' => $holding])
2024-08-26 21:34:13 -05:00
</x-ib-card>
<x-ib-card title="{{ __('Splits') }}" class="md:col-span-3">
2024-09-06 23:15:43 -05:00
@if($holding->splits->isEmpty())
<div class="flex justify-center items-center h-full pb-10 text-secondary">
{{ __('No splits for :symbol yet', ['symbol' => $holding->symbol]) }}
</div>
@endif
2024-08-27 18:12:51 -05:00
@foreach ($holding->splits->take(5) as $split)
<x-list-item :item="$split">
<x-slot:value>
2024-09-06 23:15:43 -05:00
1:{{ $split->split_amount }}
2024-08-27 18:12:51 -05:00
</x-slot:value>
<x-slot:sub-value>
2024-09-05 20:41:07 -05:00
<span title="{{ __('Distribution Date') }}">{{ $split->date->format('F d, Y') }}</span>
2024-08-27 18:12:51 -05:00
</x-slot:sub-value>
</x-list-item>
2024-08-26 21:34:13 -05:00
2024-08-27 18:12:51 -05:00
@endforeach
2024-08-26 21:34:13 -05:00
</x-ib-card>
</div>
2024-08-26 19:52:46 -05:00
</div>
</x-app-layout>