orderBy('created_at', 'desc') ->with('client.contacts') ->withArchived() ->dateRange($this->startDate, $this->endDate); foreach ($tasks->get() as $task) { $this->data[] = [ $task->client ? ($this->isExport ? $task->client->getDisplayName() : $task->client->present()->link) : trans('texts.unassigned'), $this->isExport ? $task->getStartTime() : link_to($task->present()->url, $task->getStartTime()), $task->present()->project, $task->description, Utils::formatTime($task->getDuration()), ]; } } }