Back

Blade templating "syntax error, unexpected end of file"


nacim444 posted 4 years ago

Hello everybody, here is my index.blade.php file :

@extends ("layouts.main")


@section("content")

<div id="admin">
	<h1>Categories Admin Panel</h1><hr>

	<p>Here you can view, create delete categories</p>
	<h2>Categories</h2><hr>

	<ul>
	@foreach ($categories as $category)
   <li>{{$category->name}} - {{Form::open(array('url'=>'admin/categories/destroy','class'=>'form-inline'))}}
	{{Form::hidden('id',$category->id)}}
	{{Form::submit('delete')}}
	{{Form::close()}}
    </li>

	@endforearch
	</ul>
</div>

	<h2>Create new category</h2><hr>

	@if ($errors->has())

	
	<div id="form-errors">
		<p>The following errors have acured:</p>
		<ul>
			@foreach ($errors->all() as $error)
			<li>{{$error}}</li>
			@endforeach
		</ul>
	</div>	
	@endif
		

		{{Form::open(array('url'=>'admin/categories/create'))}}
		<p>
		{{Form::label('name')}}
		{{Form::text('name')}}
		</p>
		{{Form::submit('create category',array('class'=>'secondary-cart-btn'))}}
		{{Form::close()}}
@stop

This code return an syntax error ! is there any error that cant cause that ? thx for your help

nacim444 replied 4 years ago Solution

Solved, a bad closing tag ( @endforeaRch) !


Sign in to participate in this thread!



We'd like to thank these amazing companies for supporting us