feat: add ability to archive a contact (#1769)

This commit is contained in:
Alexis Saettler
2018-10-26 21:33:24 -04:00
committed by Régis Freyd
parent 3f2c657655
commit a98b762195
25 changed files with 329 additions and 69 deletions
+8 -3
View File
@@ -27,13 +27,18 @@ class DashboardController extends Controller
)->with('debts.contact')
->first();
if ($account->contacts()->count() === 0) {
if ($account->contacts()->real()->active()->count() === 0) {
return view('dashboard.blank');
}
// Fetch last updated contacts
$lastUpdatedContactsCollection = collect([]);
$lastUpdatedContacts = $account->contacts()->where('is_partial', false)->latest('updated_at')->limit(10)->get();
$lastUpdatedContacts = $account->contacts()
->real()
->active()
->latest('updated_at')
->limit(10)
->get();
foreach ($lastUpdatedContacts as $contact) {
$data = [
'id' => $contact->hashID(),
@@ -60,7 +65,7 @@ class DashboardController extends Controller
$data = [
'lastUpdatedContacts' => $lastUpdatedContactsCollection,
'number_of_contacts' => $account->contacts()->real()->count(),
'number_of_contacts' => $account->contacts()->real()->active()->count(),
'number_of_reminders' => $account->reminders_count,
'number_of_notes' => $account->notes_count,
'number_of_activities' => $account->activities_count,