| Conditions | 1 |
| Paths | 1 |
| Total Lines | 16 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | public function index() |
||
| 16 | { |
||
| 17 | $articles = Article::with('category', 'user') |
||
| 18 | ->latest() |
||
| 19 | ->limit(6) |
||
| 20 | ->get(); |
||
| 21 | |||
| 22 | $comments = Comment::with('user') |
||
| 23 | ->whereHas('article', function ($query) { |
||
| 24 | $query->where('is_display', true); |
||
| 25 | }) |
||
| 26 | ->latest() |
||
| 27 | ->limit(4) |
||
| 28 | ->get(); |
||
| 29 | |||
| 30 | return view('page.index', ['articles' => $articles, 'comments' => $comments]); |
||
| 31 | } |
||
| 61 |