Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

freeza's avatar

sweetalert - html content

Hello guys, i want to display html content to the sweetalert js function but i doesn't work because there are whitespaces in the html. Do you know a blade or php function to remove them?

Or a better method to display html content of a blade template in sweetalerts popup?

Thanks!

        swal({   
            title: 'Check-In',
            text: '@include("team.partials.popup-portrait")',
            type: "warning",
            html: true,
            showCancelButton: true,
            showLoaderOnConfirm: true }, function() {   
                console.log('here');
            }
        );
0 likes
0 replies

Please or to participate in this conversation.