Add ability to export a contact as CSV (#840)

This commit is contained in:
Régis Freyd
2018-01-21 22:28:47 -05:00
committed by GitHub
parent 8e6da8c914
commit a5a602033d
14 changed files with 607 additions and 3 deletions
@@ -9,6 +9,7 @@ use Validator;
use App\Contact;
use App\ContactFieldType;
use App\Jobs\ResizeAvatars;
use App\Helpers\VCardHelper;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Storage;
@@ -433,4 +434,20 @@ class ContactsController extends Controller
return ['noResults' => trans('people.people_search_no_results')];
}
}
/**
* Download the contact as vCard.
* @param Contact $contact
* @return
*/
public function vCard(Contact $contact)
{
if (config('app.debug')) {
\Debugbar::disable();
}
$vcard = VCardHelper::prepareVCard($contact);
return $vcard->download();
}
}