Search code examples
phplaravelsweetalertsweetalert2

How to add quotes in Swal text without being replaced with "?


const sc = {...swalConfig.confirm}; sc.text = "{{ __('Taking the records from the table \"USERS\" to the "ROLES" table, without any additional action.') }}";

I have this code. But when rendered in browser the \" is shown as ". Any idea how to avoid this?


Solution

  • You should embed it as html. Try this:

    var text = `{!! __('Taking the records from the table \"USERS\" to the \"ROLES\" table, without any additional action.') !!}`;
    console.log(text);