Why syntax error, unexpected 'endforeach' (T

i have created a view form blade template for showing database data. Now running the script showing fatal error for foreach loop when i ending foreach loop by @endforeach, what will be the solution

  <!DOCTYPE html>
<html>
<head>
    <title>All userinfo</title>
<link rel="stylesheet" type="text/css" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">

</head>
<body>

<div class="container">
    <div class="row col-md-6 col-md-offset-2 custyle">
    <table class="table table-striped custab">
    <thead>
    <a href="userinfo/create" class="btn btn-primary btn-xs pull-right"><b>+</b> Add new categories</a>
        <tr>
            <th>ID</th>
            <th>Name</th>
            <th>Email</th>
            <th>Age</th>
            <th>Hometown</th>
            <th class="text-center">Action</th>
        </tr>
    </thead>

    foreach($alldata as $data)

            <tr>
                <td>{{ $data -> id }}</td>
                <td>{{ $data -> name }}</td>
                <td>{{ $data -> email }}</td>
                <td>{{ $data -> age }}</td>
                <td>{{ $data -> hometown }}</td>

                <td class="text-center"><a class='btn btn-info btn-xs' href="#"><span class="glyphicon glyphicon-edit"></span> Edit</a> <a href="#" class="btn btn-danger btn-xs"><span class="glyphicon glyphicon-remove"></span> Del</a></td>
            </tr>

           @endforeach

    </table>
    </div>
</div>

</body>
</html>

在这里你忘了@

@foreach($alldata as $data)
链接地址: http://www.djcxy.com/p/53086.html

上一篇: Laravel Zizaco角色和权限错误BadMethod错误

下一篇: 为什么语法错误,意想不到的'endforeach'(T