Laravel – Explode doesn't work with a string coming from JS
// js <script> // when button clicked let tags = 'foo,bar'; elem.innerHTML += `<x-post tags="${tags}"></x-post>` </script> // post.blade.php @php var_dump($tags); // string(9) "foo,bar" $tags = explode(',',$tags); // exploding echo "<br>"; var_dump($tags); // array(1) { [0] => string(9) "foo,bar"} @endphp How…