dimanche 22 mai 2016

Undefined variable: section (View: D:\xampp\htdocs\laravel5\resources\views\cms\sections.blade.php)

i try to made simple crud and found this error

Undefined variable: section (View:D:\xampp\htdocs\laravel5\resources\views\cms\sections.blade.php)

// my routes

Route::resource('sections','SectionsController');

view

{!! Form::open(["url"=>"sections","files" => "true"]) !!} section name: {!! Form::text("section_name")!!} <hr/>

{!! Form::file('image',["class"=>"filestyle","data-buttonText"=>"select image","data-input"=>"false"]) !!} <br/>

{!! Form::submit("insert@upload",["class"=>"btn btn-primary"]) !!} {!! Form::close() !!} 
<div class="row"> <h3>get data from db ::</h3>  @foreach($sections as $section)
 <div class="col-md-3">  <div class="thumbnail"> <p></p> 
<img src="/uploads/" width="90%" height="90%"></div> </div>@endforeach

</div> 

<div class="row"><div class="col-md-4"> <div class="thumbnail">

 {!! Form::open(["url"=>"sections/$section->id","method" => "patch"]) !!} 

{!! Form::text("section_name",$section->section_name)!!} {!! Form::submit("update",["class"=>"btn btn-success"]) !!} {!! Form::close() !!} </div> </div>

 <div class="col-md-4"> <div class="thumbnail">

{!! Form::open(["url"=>"sections/$section->id","method" => "delete"]) !!} 

{!! Form::submit("delete",["class"=>"btn btn-danger"]) !!} {!! Form::close() !!} </div> </div>  </div> </div> 



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1WJbirs
via IFTTT

Aucun commentaire:

Enregistrer un commentaire