Why syntax error, unexpected 'endforeach' (T_ENDFOREACH) in Laravel 5.3?
<p>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 </p>

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

&lt;/head&gt;
&lt;body&gt;

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

    foreach($alldata as $data)

            &lt;tr&gt;
                &lt;td&gt;{{ $data -&gt; id }}&lt;/td&gt;
                &lt;td&gt;{{ $data -&gt; name }}&lt;/td&gt;
                &lt;td&gt;{{ $data -&gt; email }}&lt;/td&gt;
                &lt;td&gt;{{ $data -&gt; age }}&lt;/td&gt;
                &lt;td&gt;{{ $data -&gt; hometown }}&lt;/td&gt;

                &lt;td class="text-center"&gt;&lt;a class='btn btn-info btn-xs' href="#"&gt;&lt;span class="glyphicon glyphicon-edit"&gt;&lt;/span&gt; Edit&lt;/a&gt; &lt;a href="#" class="btn btn-danger btn-xs"&gt;&lt;span class="glyphicon glyphicon-remove"&gt;&lt;/span&gt; Del&lt;/a&gt;&lt;/td&gt;
            &lt;/tr&gt;

           @endforeach

    &lt;/table&gt;
    &lt;/div&gt;
&lt;/div&gt;

&lt;/body&gt;
&lt;/html&gt;
</code></pre>