Skip to content

Instantly share code, notes, and snippets.

@achmadfatoni
Last active September 17, 2016 01:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save achmadfatoni/26622c389faf7d61752d9b79e946d2db to your computer and use it in GitHub Desktop.
Save achmadfatoni/26622c389faf7d61752d9b79e946d2db to your computer and use it in GitHub Desktop.
index.blade.php
@extends('app')
@section('content')
<div class="container">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<div class="panel panel-default">
<div class="panel-heading">Todo List</div>
<div class="panel-body">
<a href="{{ url('todos/create') }}" class="btn btn-primary">Add todo</a>
<br>
<br>
<br>
<div class="table-responsive">
<table class="table">
<tr>
<th>Name</th>
<th>Is Done</th>
<th>Action</th>
</th>
@if(! count($todos))
<tr>
<td colspan="3">No todo</td>
</tr>
@endif
@foreach($todos as $todo)
<tr>
<td>{{ $todo->name }}</td>
<td>{{ $todo->is_done ? 'Done' : 'Not Done' }}</td>
<td>
<a class="btn btn-warning" href="{{ url('todos/'.$todo->id.'/edit') }}">Edit</a>
<a class="btn btn-danger" href="{{ url('todos/'.$todo->id.'/delete') }}">Delete</a>
</td>
</tr>
@endforeach
</table>
</div>
</div>
</div>
</div>
</div>
</div>
@endsection
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment