wip import backup

This commit is contained in:
hackerESQ
2024-08-27 22:41:13 -05:00
parent 12f3003a3a
commit 5e4b30e516
11 changed files with 60 additions and 150 deletions
+10 -10
View File
@@ -73,6 +73,15 @@
{{ Number::currency($holding->dividends_earned ?? 0) }}
</p>
<p class="pt-2 text-sm">
{{ __('Market Data Age') }}:
{{ \Carbon\Carbon::parse($market_data->updated_at)->diffForHumans() }}
</p>
</x-ib-card>
<x-ib-card title="{{ __('Fundamentals') }}" class="md:col-span-4">
<p>
<span class="font-bold">{{ __('52 week') }}: </span>
@@ -83,16 +92,7 @@
/>
</p>
<p class="pt-2 text-sm">
{{ __('Market Data Age') }}:
{{ \Carbon\Carbon::parse($market_data->updated_at)->diffForHumans() }}
</p>
</x-ib-card>
<x-ib-card title="{{ __('Fundamentals') }}" class="md:col-span-4">
<p>
<span class="font-bold">{{ __('Forward PE') }}: </span>
{{ $market_data->forward_pe }}
+3 -28
View File
@@ -1,37 +1,14 @@
<x-app-layout>
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
<x-forms.form-section submit="updateProfileInformation">
<x-slot name="title">
{{ __('Import') }}
</x-slot>
<x-slot name="description">
{{ __('Upload or recover your Investbrain portfolio and holdings.') }}
</x-slot>
<x-slot name="form">
<!-- Name -->
<div class="col-span-6 sm:col-span-4">
@livewire('import-portfolios-field')
</div>
</x-slot>
<x-slot name="actions">
<x-button type="submit">
{{ __('Import') }}
</x-button>
</x-slot>
</x-forms.form-section>
@livewire('import-portfolios-field')
<x-section-border />
</div>
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
<x-forms.action-section submit="updateProfileInformation">
<x-forms.action-section>
<x-slot name="title">
{{ __('Export') }}
</x-slot>
@@ -42,11 +19,9 @@
<x-slot name="content">
<!-- Name -->
<div class="col-span-6 sm:col-span-4">
@livewire('export-portfolios-button')
</div>
</x-slot>
@@ -3,6 +3,7 @@
use Livewire\WithFileUploads;
use Livewire\Volt\Component;
use Mary\Traits\Toast;
use App\Imports\BackupImport;
new class extends Component {
use Toast;
@@ -12,12 +13,41 @@ new class extends Component {
public $file;
// methods
public function mount()
public function import()
{
//
$import = (new BackupImport)->import($this->file);
$this->success(__('Successfully imported!'));
// Artisan::queue(RefreshHoldingData::class);
}
}; ?>
<x-file wire:model="file" label="{{ __('Select a file') }}" hint="" accept="application/pdf" required />
<x-forms.form-section submit="import">
<x-slot name="title">
{{ __('Import') }}
</x-slot>
<x-slot name="description">
{{ __('Upload or recover your Investbrain portfolio and holdings.') }}
</x-slot>
<x-slot name="form">
<div class="col-span-6 sm:col-span-4">
<x-file wire:model="file" label="{{ __('Select a file') }}" hint="" accept=".xlsx" required />
</div>
</x-slot>
<x-slot name="actions">
<x-button type="submit">
{{ __('Import') }}
</x-button>
</x-slot>
</x-forms.form-section>