-1

So I've been getting the error for a bit now, and I can't find anything wrong with the code, was hoping for a little bit of help, since Laravel is still rather new for me, so I'm not 100% on some terms and such.

@extends('admin.atemplate')
@section('admin-content')

<h1> Orders </h1>
@if($orders-isEmpty())
<p> No orders here </p>
@else
<div class="table-responsive">
    <table class="table table-hover table-dark ">
      <thead>
        <tr>
          <th scope="col">#</th>
          <th scope="col"> Content </th>
          <th scope="col"> User </th>
          <th scope="col"> Created at </th>
        </tr>
      </thead>
      <tbody>
          @foreach($orders as $order)
        <tr>
          <th scope="row">{{$order->id}}</th>
          <td>@foreach(json_decode($order->order_list) as $item)
              <p> {{$item->name . ',' . $item->qty . ' x ' . $item->proxe . '=' . $item->subtotal}} </p>
          </td>
          <td>{{$order->user_id}}</td>
          <td>{{$order->created_at}}</td>
        </tr>
        @endforeach
      </tbody>
    </table>
</div>
@endelseif
@endsection

Sorry if my question is kinda dumb, but I thank you for any help!

Shira
  • 61
  • 1
  • 2
  • 9
  • Does this answer your question? [PHP parse/syntax errors; and how to solve them](https://stackoverflow.com/questions/18050071/php-parse-syntax-errors-and-how-to-solve-them) – Dave Nov 23 '20 at 19:39

3 Answers3

0

There is no @endelseif directive, its just @endif. So you are leaving an if/else block open at the moment.

lagbox
  • 48,571
  • 8
  • 72
  • 83
0

Your mistake is @endelseif ، Change this to @endif

mohammad
  • 11
  • 5
0

You opened the @foreach twice and closed it once

mohammad
  • 11
  • 5