{{-- INPUTS: message: string|required ?type: success|error|info - defaults to info ?title: string|nullable PHP --------- return redirect() ->back() ->with([ new ToastMessage( 'Successfully Done something!', // message 'success', // type 'My title' // title ) ]); Javascript - alpine -------------------- this.$dispatch('addtoast', { message: 'testing testing' type: 'success', }); Javascript - vanilla -------------------- window.dispatchEvent(new CustomEvent("addtoast", { detail: { message: 'Hello there' } }); --}} @php $toast = session('toast'); @endphp