I'm trying to mount a filter where I'm looking for some options from the DB I made a foreach to bring this data from the DB but it's 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>