Files
investbrain/resources/views/livewire/import-portfolios-field.blade.php
T

54 lines
1.0 KiB
PHP
Raw Normal View History

2024-08-07 19:00:56 -05:00
<?php
2024-08-07 19:02:58 -05:00
use Livewire\WithFileUploads;
2024-08-07 19:00:56 -05:00
use Livewire\Volt\Component;
use Mary\Traits\Toast;
2024-08-27 22:41:13 -05:00
use App\Imports\BackupImport;
2024-08-07 19:00:56 -05:00
new class extends Component {
use Toast;
2024-08-07 19:02:58 -05:00
use WithFileUploads;
2024-08-07 19:00:56 -05:00
// props
public $file;
// methods
2024-08-27 22:41:13 -05:00
public function import()
2024-08-07 19:00:56 -05:00
{
2024-08-27 22:41:13 -05:00
$import = (new BackupImport)->import($this->file);
$this->success(__('Successfully imported!'));
// Artisan::queue(RefreshHoldingData::class);
2024-08-07 19:00:56 -05:00
}
}; ?>
2024-08-27 22:41:13 -05:00
<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>