if (strlen($link) > 7 && substr($link, 0, 7) === $prefix) { $title = substr($title, 7); } else { $link = $prefix . $link; } return link_to($link, $title, array('target' => '_blank')); } public function getDateCreated() { if ($this->created_at == '0000-00-00 00:00:00') { return '---'; } else { return $this->created_at->format('m/d/y h:i a'); } } } /* Client::created(function($client) { Activity::createClient($client); }); */ Client::updating(function ($client) { Activity::updateClient($client); }); Client::deleting(function ($client) { Activity::archiveClient($client); }); Client::restoring(function ($client) { Activity::restoreClient($client); });