Add ability to export a contact as CSV (#840)
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user