File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed
Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments