public function lastCreatedAt()
{
$workflows = $this->all();
usort($workflows, function ($a, $b) {
$a_created_after_b = $a->get('created_at') >= $b->get('created_at');
if ($a_created_after_b) {
$cmp = -1;
} else {
$cmp = 1;
}
return $cmp;
});
if (count($workflows) > 0) {
$timestamp = $workflows[0]->get('created_at');
} else {
$timestamp = null;
}
return $timestamp;
}