Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

435
Views
Laravel: extraño inesperado 'endif'

Estoy tratando de cargar algunos datos de la base de datos en mi Vista y he codificado esto:

 @forelse($wallets as $wallet) <td>{{ $wallet->title }}</td> <td>{{ $wallet->name }}</td> <td> @if(($wallet->is_active)==1) Active @else Deactive @endif </td> <td> @if(($wallet->is_cachable)==1) Cachable @else Un Cachable @endif </td> @endforelse

Pero me sale esto:

error de sintaxis, 'endif' inesperado (T_ENDIF)

Sin embargo, como puede ver, cerré el if correctamente diciendo: @endif

Entonces, ¿qué está yendo mal aquí?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Su sintaxis para @forelse es incorrecta.

Debe colocar un @empty en algún lugar intermedio que se representará cuando $wallets esté vacío:

 @forelse($wallets as $wallet) <td>{{ $wallet->title }}</td> <td>{{ $wallet->name }}</td> <td> @if(($wallet->is_active)==1) Active @else Deactive @endif </td> <td> @if(($wallet->is_cachable)==1) Cachable @else Un Cachable @endif </td> @empty <p>No wallet data available</p> @endforelse

Bucle en hoja.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!