add validation to import
This commit is contained in:
@@ -82,17 +82,6 @@
|
||||
|
||||
<x-ib-card title="{{ __('Fundamentals') }}" class="md:col-span-4">
|
||||
|
||||
<p>
|
||||
<span class="font-bold">{{ __('52 week') }}: </span>
|
||||
|
||||
<x-fifty-two-week-range
|
||||
:low="$market_data->fifty_two_week_low"
|
||||
:high="$market_data->fifty_two_week_high"
|
||||
:current="$market_data->market_value"
|
||||
/>
|
||||
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<span class="font-bold">{{ __('Forward PE') }}: </span>
|
||||
{{ $market_data->forward_pe }}
|
||||
@@ -108,6 +97,17 @@
|
||||
${{ Number::forHumans($market_data->market_cap ?? 0) }}
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<span class="font-bold">{{ __('52 week') }}: </span>
|
||||
|
||||
<x-fifty-two-week-range
|
||||
:low="$market_data->fifty_two_week_low"
|
||||
:high="$market_data->fifty_two_week_high"
|
||||
:current="$market_data->market_value"
|
||||
/>
|
||||
|
||||
</p>
|
||||
|
||||
</x-ib-card>
|
||||
|
||||
<x-ib-card title="{{ __('Recent activity') }}" class="md:col-span-3">
|
||||
|
||||
@@ -4,18 +4,22 @@ use Livewire\WithFileUploads;
|
||||
use Livewire\Volt\Component;
|
||||
use Mary\Traits\Toast;
|
||||
use App\Imports\BackupImport;
|
||||
use Livewire\Attributes\Rule;
|
||||
|
||||
new class extends Component {
|
||||
use Toast;
|
||||
use WithFileUploads;
|
||||
|
||||
// props
|
||||
#[Rule('required|file|mimes:xlsx|max:2048')]
|
||||
public $file;
|
||||
|
||||
// methods
|
||||
public function import()
|
||||
{
|
||||
|
||||
$this->validate();
|
||||
|
||||
$import = (new BackupImport)->import($this->file);
|
||||
|
||||
$this->success(__('Successfully imported!'));
|
||||
|
||||
Reference in New Issue
Block a user