@foreach($tasks as $task)
<tr>
    <td>{{ $task->document->title ?? '-' }}</td>
    <td>{{ $task->current_stage ?? '-' }}</td>
    <td>{{ $task->status }}</td>
    <td>{{ $task->assignedRole->name ?? ($task->assignedUser->name ?? '-') }}</td>
    <td>
        <a href="{{ url('workflow/tasks/' . $task->id) }}" class="btn btn-sm btn-info">View</a>
    </td>
</tr>
@endforeach
