@extends('layout') @section('content') @php $task = $task ?? null; $defaults = $defaults ?? []; $editing = $task !== null; $source = $editing ? (array) $task : $defaults; $value = static fn (string $key, mixed $default = '') => $source[$key] ?? $default; $dateValue = static fn (string $key) => $value($key) ? date('Y-m-d\TH:i', strtotime((string) $value($key))) : ''; $context = (string) $value('context', !empty($source['system_id']) ? 'system:'.(int) $source['system_id'] : (!empty($source['project_id']) ? 'project:'.(int) $source['project_id'] : '')); $checklist = $value('checklist', []); if (is_string($checklist)) $checklist = json_decode($checklist, true) ?: []; $action = $editing ? 'tarefas/'.$task->id : 'tarefas'; @endphp
Registre o trabalho e relacione-o ao contexto correto.