@forelse within @forlese

Asked

Viewed 110 times

0

Hello, I need to make one @forlese within a @forlese in Laravel:

<div class="row">
    <div class="col-md-12">
        <h3>Contas cadastradas</h3>
        <table class="table table-striped">
            <tr>
                <th>Fornecedor</th>
                <th>Data de Emissão</th>
                <th>Data de Vencimento</th>
                <th>Sequência</th>
                <th>Valor</th>
                <th>Tipo</th>
                <th>Conta Resultado</th>
                <th>Mais opções</th>
            </tr>
            @forelse($FinContaspagar as $contas)
                @forelse($FinContaspagarDetalhe as $detalhe)
                <tr>
                    <td>{{ $contas->getTerceiro() }}</td>
                    <td>{{ $contas->getDtemissao()->format("d-m-Y") }}</td>
                    <td>{{ $contas->getDtvencimento()->format("d-m-Y") }}</td>
                    <td>{{ $detalhe->getSequencia() }}</td>
                    <td>R$ {{ $detalhe->getValor() }}</td>
                    <td>{{ $detalhe->getTipo() }}</td>
                    <td>{{ $detalhe->getContaResultado() }}</td>
                    <td>
                        <a href="{{ url('contas/editar/'.$contas->getCodigo()) }}">Editar</a>
                        |
                        <a href="{{ url('contas/apagar/'.$contas->getCodigo()) }}">Apagar</a>
                    </td>
                </tr>
            @empty  
                <tr>
                    <td colspan="5">Não há ações neste momento!</td>
                </tr>
                @endforelse
            @endforelse
        </table>
    </div>
</div>

But the return I have is:

FatalErrorException in 21634628c350161c40fd94debe415477685a25b0.php line 102:
syntax error, unexpected 'endif' (T_ENDIF)

I must close the @endforelse before?

  • What is the code of line 102?

  • @Virgilionovic That line doesn’t even exist... the code goes to line 92

  • Look it’s impossible not to exist, check the file 21634628c350161c40fd94debe415477685a25b0.php which is in the folder storage\framework\views ...

1 answer

0

@foreach ($propostas as $proposta)
    <h1>Dados da proposta</h1>
    Solicitante: {{ $proposta->solicitante }}
    Data: {{ $proposta->data }}
        <h2>Serviços da proposta</h2>
        @foreach ($propostas->servicos as $servico)
            Descrição: {{ $servico->descricao }}
            Valor: {{ $servico->valor }}
        @endforeach
    Total: {{ $proposta->total }}
@endforeach
  • Tharles, welcome to Stackoverflow! It would be interesting if you added a short explanation of how it answers the question.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.