Laravel Vue toastr show blank notification

44 Views Asked by At
import toastr from 'toastr'

function store() {
        let nomor_induk_pegawai = pegawai.nomor_induk_pegawai
        let nama_pegawai = pegawai.nama_pegawai
        let id_departemen = pegawai.id_departemen
        let email = pegawai.email
        let telepon = pegawai.telepon
        let gender = pegawai.gender
        let status = pegawai.status

        axios.post('http://localhost:8000/api/pegawais', {
            nomor_induk_pegawai: nomor_induk_pegawai,
            nama_pegawai: nama_pegawai,
            id_departemen: id_departemen,
            email: email,
            telepon: telepon,
            gender: gender,
            status: status
        }).then(() => {
            toastr.success('Berhasil menambah pegawai')
            //redirect to post index
            router.push({
                name: 'pegawai.index'
            })
        }).catch(error => {
            //assign state validation with error
            validation.value = error.response.data
        })
    }

i want to make toastr notification on create but only show blank white notification. I already install

composer require yoeunes/toastr

npm install toastr --save

in laravel and vue. i also add in bootstrap.js

window.toastre = require('toastr');

can someone help me?

0

There are 0 best solutions below