e6f38d9481
* docs: remove requirement for setting APP_KEY manually * optimize date picker * clean up modals * spot light working * reorganization * add lazy load * wip * remove filament * styling
33 lines
735 B
PHP
33 lines
735 B
PHP
<?php
|
|
|
|
use App\Exports\BackupExport;
|
|
use App\Traits\Toast;
|
|
use Illuminate\Support\Facades\RateLimiter;
|
|
use Livewire\Volt\Component;
|
|
use Maatwebsite\Excel\Facades\Excel;
|
|
|
|
new class extends Component
|
|
{
|
|
use Toast;
|
|
|
|
// props
|
|
|
|
// methods
|
|
public function export()
|
|
{
|
|
if (! RateLimiter::attempt('export:'.auth()->user()->id, $perMinute = 3, fn () => null)) {
|
|
|
|
$this->error(__('Hang on! You\'re doing that too much.'));
|
|
|
|
return;
|
|
}
|
|
|
|
return Excel::download(new BackupExport, now()->format('Y_m_d').'_investbrain_backup.xlsx');
|
|
}
|
|
}; ?>
|
|
|
|
<div>
|
|
<x-ui.button type="submit" @click="$wire.export" spinner="export">
|
|
{{ __('Download Export') }}
|
|
</x-ui.button>
|
|
</div>
|