article.blade.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. @if($articles)
  2. <ol class="article-list">
  3. @foreach ($articles as $article)
  4. <li>
  5. <h4 class='title'>
  6. <a href="{{ route('article',['id' => $article->id]) }}" target="_blank">
  7. {{$article->title}}
  8. </a>
  9. </h4>
  10. <p class="desc">
  11. {{$article->desc}}
  12. </p>
  13. <p class="info">
  14. <span>
  15. <i class="glyphicon glyphicon-calendar"></i>{{ date('Y-m-d', strtotime($article->created_at)) }}
  16. </span>
  17. &nbsp;
  18. @if($article->category)
  19. <span>
  20. <i class="glyphicon glyphicon-th-list"></i>
  21. <a href="{{ route('category', ['id' => $article->cate_id]) }}" target="_blank">
  22. {{ $article->category->name }}
  23. </a>
  24. </span>
  25. @endif
  26. <span>
  27. <i class="glyphicon glyphicon-eye-open"></i> {{ $article->read_count }} views
  28. </span>
  29. </p>
  30. </li>
  31. @endforeach
  32. </ol>
  33. {!! $articles->links() !!}
  34. @else
  35. <h3>没有文章哟!!!</h3>
  36. @endif