Skip to content

Commit d05dd1c

Browse files
committed
Premiers changement pour la page d'index des todos
1 parent 8d5d569 commit d05dd1c

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

app/Http/Controllers/TodoController.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ class TodoController extends Controller
1515
public function index()
1616
{
1717
//
18-
$datas = Todo::all()->reject(function ($todo) {
19-
return $todo->done == 0;
20-
});
18+
$datas = Todo::all();
19+
// $datas = Todo::all()->reject(function ($todo) {
20+
// return $todo->done == 0;
21+
// });
2122

2223
return view('todos.index', compact('datas'));
2324

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
@extends('layouts.app')
2+
3+
@section('content')
14
@foreach ($datas as $data)
2-
<h4> Nom : {{ $data->name}} | Done : {{ $data->done }}</h4>
5+
<div class="alert alert-primary" role="alert">
6+
<strong>{{ $data->name}} @if($data->done)<span class="badge badge-success">done</span>@endif</strong>
7+
</div>
38
@endforeach
9+
@endsection

0 commit comments

Comments
 (0)