Explorar o código

Show that there are no comments if there are indeed no comments

axkuhta hai 1 ano
pai
achega
c6b8a8cdae
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      resources/views/include/comments.blade.php

+ 4 - 0
resources/views/include/comments.blade.php

@@ -34,9 +34,13 @@
 
 	<input type="submit">
 </form>
+@if (count($comments) == 0)
+	<p>Комментариев нет.</p>
+@else
 @foreach ($comments as $row)
 	<p>
 		<div>{{ $row->name }} ({{ $row->created_at }}):</div>
 		<div>{{ $row->content }}</div>
 	</p>
 @endforeach
+@endif