3
我是Laravel初学者;请帮我解决这个错误。如果其他问题在Laravel查看
我希望根据投诉表中的状态值将状态打印为“已阅读”或“待定”。
CODE
@if($complaints->count())
@foreach($complaints as $complaint)
<tr>
<td>{{ $complaint->title }}</td>
<td>{{ $complaint->description }}</td>
@if($complaints->status === 0)
<td>Pending</td>
@else
<td>Viewed</td>
@endif
<td>{{ $complaint->created_at }}</td>
<td><a href="{{ url('complaints/show',$complaint->id) }}">View</a></td>
</tr>
@endforeach
错误信息
未定义的属性: 照亮\分页\ LengthAwarePaginator :: $状态(查看: C:\ XAMPP \ htdocs中\ E- village \ resources \ views \ complaints \ index.blade.php)
如果我删除以下行,一切都会正常工作。
@if($complaints->status === 0)
<td>Pending</td>
@else
<td>Viewed</td>
@endif
'$ complaints'是分页程序的一个实例。 Typo的男人,错字的。 –