Support the ongoing development of Laravel.io →
posted 10 years ago
Blade

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

Last updated 2 years ago.
0

Solved, a bad closing tag ( @endforeaRch) !

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

nacim444 nacim444 Joined 14 Sep 2014

Moderators

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

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.