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