1
I’m trying to set up a filter where I search some options BD I made a foreach to bring this data from BD but is bringing an error:
Trying to get property of non-object
Follow my code:
Controller
public function index()
{
$categoria = $this->catimage->get();
return view('administrator.images.index', compact('categoria'));
}
View
<div class="row">
<ul class="simplefilter">
Filtros:
<li class="active" data-filter="all">All</li>
@foreach ($categoria as $categoria)
<li data-filter="{{$categoria ->id}}">{{$categoria ->title}}</li>
@endforeach
</ul>
</div>
This error is in the controller or in the view?
– Miguel
This error is in View
– Shaolin Fantastic