livewire-alert
livewire-alert copied to clipboard
Flash Notification not working properly
I want to say thank you for creating this package, this package really helpful. But i found a problem when i want to use flash notification. The store function was working well no error, but the notification flash isn't working properly, only redirect and then no flash notif is showing. Any solution with my issue? Here is my code : `public function store() { Leave::create([ 'karyawan_id' => auth()->user()->id, 'manager_id' => $this->manager->id, 'department_id' => auth()->user()->department_id, 'jenis_cuti' => $this->jenis_cuti, 'tanggal_pengajuan' => Carbon::now(), 'tanggal_cuti' => $this->startDate, 'tanggal_masuk' => $this->endDate, 'jumlah_hari' => $this->jumlah_hari, 'keperluan_cuti' => $this->keperluan_cuti, 'alamat_cuti' => $this->alamat_cuti, 'no_telp_cuti' => $this->no_telp_cuti, 'status_cuti' => 'PENDING', ]);
$this->flash('success', 'Pengajuan cuti berhasil', [
'position' => 'center',
'timer' => 3000,
'toast' => true,
], '/');
}
public function confirmation()
{
$this->validate();
$this->alert('warning', 'Kirim pengajuan cuti', [
'position' => 'center',
'timer' => '60000',
'toast' => false,
'showConfirmButton' => true,
'onConfirmed' => 'store',
'showCancelButton' => true,
'onDismissed' => '',
'cancelButtonText' => 'Batal',
'confirmButtonText' => 'Ya',
]);
}`
Hi @septianinet
How did you set it up? also, is there any error in the console?
Have you found the solution? @septianinet @jantinnerezo
I have the same problem when I want to use flash notification. At first everything went well, but after a while it didn't work
Hi @septianinet
Can you show me how did you set it up?
Facing the same issue, I'm using the npm version of sweetalert2
import Swal from 'sweetalert2';
window.Swal = Swal;
The error is,
(index):1048 Uncaught (in promise) ReferenceError: Swal is not defined
Working fine on alert() but not with flash()
#137 will fix this issue