I have a problem with helpers , I create correctly the helper and I can call this helper that I created in view but when I need to access to property.
{{Text::showBanner()}};
The function of helperI created called showBanner
public static function showBanner() {
$banner= Banner::all();
return $banner;
}
How can I access to attribute id of $banner ?
UPDATED
When I use this
@foreach ( $banners as $item)
{{$item}}
@endforeach
I need to change this $banner for this helper
Banner::all()gives you all banners. A collection and not a single model. That's probably the problem here.