Not Completed ({{ $todos->count() }})

@foreach ($todos as $todo) @if ($todo->projects->isNotEmpty()) @php $project = $todo->projects->first(); @endphp @endif @if (!$todo->completed_at) @php $due = null; if ($todo->due_start && $todo->due_end) { $due = \Carbon\Carbon::parse($todo->due_end); } elseif ($todo->due_start) { $due = \Carbon\Carbon::parse($todo->due_start); } elseif ($todo->due_end) { $due = \Carbon\Carbon::parse($todo->due_end); } $now = now(); $timeRemaining = $due ? ($due->isFuture() ? $now->diffForHumans($due, true) : $due->diffForHumans($now, true)) : null; @endphp
@csrf @method('PUT')
{{ $todo->title }}
{{ $project->name }}
@if ($timeRemaining !== null)

{{ $timeRemaining }} {{ $due->isFuture() ? 'remaining' : 'ago' }}

@endif
@endif @endforeach