feat: count the number of times a contact is seen (#1868)

This commit is contained in:
Régis Freyd
2018-10-02 07:18:28 -04:00
committed by GitHub
parent 33c39302f1
commit 5dbedb6407
3 changed files with 43 additions and 0 deletions
@@ -173,8 +173,11 @@ class ContactsController extends Controller
$contact->load(['notes' => function ($query) {
$query->orderBy('updated_at', 'desc');
}]);
$contact->last_consulted_at = now(DateHelper::getTimezone());
$contact->number_of_views = $contact->number_of_views + 1;
$contact->save();
$relationships = $contact->relationships;
// get love relationship type
$loveRelationships = $relationships->filter(function ($item) {