1 year ago

Blade file not rendering <script></script> L5.7

Posted 1 year ago by cac

I have a script tag (pure javascript) appended to the end of my html and it is not rendering the script tag. I used to simply open a script tag in older versions of laravel but now in this version it is not working. Does anyone have a clue?

        <div class="alert alert-danger">

        <div class="row">
            <input id="term" name="term" autofocus placeholder="Buscar" type="text" class="form-control">

        <div class="row">
            <table id="table" class="table table-sm  table-condensed table-hover">
                <caption>List de Carros</caption>
                <thead class="thead-dark">

                @foreach($cars as $car)
                        <td>{{ $car->model }}</td>
                        <td>{{ $car->quantity }}</td>
                        <td>{{ $car->brand->name }}</td>
                        <td>R$ {{ $car->price }}</td>
                                <a href="{{route('cars.edit',$car->id)}}">
                                    <button class="btn btn-sm btn-primary" type="button">Editar</button>
                                <form method="POST" action="{{route('cars.destroy',$car->id)}}">
                                    <button class="btn btn-sm btn-danger" type="submit">Deletar</button>
            function filterTable(event) {
                var filter =;
                var rows = document.querySelector("#table tbody").rows;
                for (var i = 0; i < rows.length; i++) {
                    var firstCol = rows[i].cells[0].textContent.toUpperCase();
                    var secondCol = rows[i].cells[1].textContent.toUpperCase();
                    var thirdCol = rows[i].cells[4].textContent.toUpperCase();
                    if (firstCol.indexOf(filter) > -1 || secondCol.indexOf(filter) > -1 || thirdCol.indexOf(filter) > -1) {
                        rows[i].style.display = "";
                    } else {
                        rows[i].style.display = "none";

            document.querySelector("#term").addEventListener('keyup', filterTable, false);
        <div class="text-center">
            <p>Nenhum registro encontrado</p>


Please sign in or create an account to participate in this conversation.