My Workflows
Manage and track your workflow tasks
My Workflow Tasks
@forelse($tasks as $task)
@if($task->status !== 'completed')
@php
$currentStep = $task->step_id ? \App\Models\WorkflowStep::find($task->step_id) : null;
$availableTransitions = $task->workflow
? $task->workflow->transitions->where('from_step_id', $task->step_id)
: collect();
$history = \App\Models\WorkflowTask::where('document_id', $task->document_id)
->where('status', 'completed')
->with(['transition.fromStep', 'transition.toStep', 'assignedUser'])
->orderBy('created_at')
->orderBy('id')
->get();
@endphp
{{ ucfirst(str_replace('_', ' ', $task->status)) }}
@endif
@empty
{{ $task->document->title ?? 'Untitled document' }}
{{ $task->workflow->name ?? '-' }}
@if($currentStep)Current: {{ $currentStep->name }}@endif
@if($task->document && $task->document->description)
@endif
{{-- Action form --}}
@if($availableTransitions->count())
@else
{{ $task->document->description }}
@endif {{-- Previous steps & their comments --}} @if($history->count())
Previous steps
-
@foreach($history as $h)
@php
$fromOrder = optional(optional($h->transition)->fromStep)->order;
$toOrder = optional(optional($h->transition)->toStep)->order;
$isReturn = !is_null($fromOrder) && !is_null($toOrder) && $toOrder < $fromOrder;
$hu = $h->assignedUser;
$huName = $hu ? (trim(($hu->first_name ?? '') . ' ' . ($hu->last_name ?? '')) ?: ($hu->name ?? 'User')) : null;
@endphp
-
{{ optional($h->transition)->name ?? 'Action' }} ({{ optional(optional($h->transition)->fromStep)->name ?? 'Start' }} → {{ optional(optional($h->transition)->toStep)->name ?? '-' }}) @if($huName){{ $huName }}@endif @if($h->created_at) · {{ $h->created_at->format('Y-m-d H:i') }}@endif@if(trim((string) $h->comment) !== ''){{ $h->comment }}@elseNo comment@endif
@endforeach
No actions available from the current step.
@endif
No workflow tasks assigned to you.
@endforelse
Workflows I Created
| Document Title | Workflow | Created At | View | Tasks |
|---|---|---|---|---|
|
{{ $doc->title }}
{{ $doc->description }}
|
{{ $doc->workflow ? $doc->workflow->name : '-' }} | {{ $doc->created_at ? $doc->created_at->format('Y-m-d H:i') : '-' }} | @if($doc->file_path) View @else No file @endif | @if($doc->tasks && $doc->tasks->count()) @else No tasks @endif | @empty
| No documents found for workflows you created. | ||||