我有热点新闻按钮可以将帖子设为热点新闻当我将帖子设为热点新闻时它工作正常但是当我没有任何热点新闻帖子时它会出现此错误。
<div class="feature_article_inner">
<div class="tag_lg red">
<a href="{{ url('/details') }}/{{ $hot_news['slug'] }}">Hot News</a>
</div>
<!-- feature_article_title -->
<div class="feature_article_title">
<h1><a href="{{ url('/details') }}/{{ $hot_news['slug'] }}" target="_self">{{ $hot_news['title'] }} </a></h1>
</div>
<!-- feature_article_date -->
<div class="feature_article_date">
by: <a href="{{ url('/author') }}/{{ $hot_news['creator']['id'] }}">{{ $hot_news['creator']['name'] }}</a> ,
{{ $hot_news['created_at']->diffForHumans() }} </a></div>
<div style="font-size: 9.5pt; color: black; "> Views: {{ $hot_news['view_count'] }} </div>
<!-- feature_article_content -->
<div class="feature_article_content">
{{ $hot_news['short_description'] }}
</div>
<!-- article_social -->
<div class="article_social">
<span>
<i class="fas fa-comment"></i>
<a href="{{ url('/details') }}/{{ $hot_news['slug'] }}">
{{ $hot_news['comments_count'] }} Comments
</a>
</span>
</div>
</div>
侃侃无极
牧羊人nacy