including working export button
This commit is contained in:
hackerESQ
2024-08-27 22:06:10 -05:00
parent e21814714d
commit 12f3003a3a
16 changed files with 39 additions and 164 deletions
@@ -2,25 +2,31 @@
use Livewire\Volt\Component;
use Mary\Traits\Toast;
use Maatwebsite\Excel\Facades\Excel;
use App\Exports\BackupExport;
use Illuminate\Support\Facades\RateLimiter;
new class extends Component {
use Toast;
// props
// methods
public function mount()
{
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-button type="submit">
<x-button type="submit" @click="$wire.export">
{{ __('Download Export') }}
</x-button>
</div>