PHPackages                             karacweb/vcard - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. karacweb/vcard

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

karacweb/vcard
==============

Generate vcards fluently.

0.0.4(9mo ago)0122↓50%MITPHPPHP ^8.2

Since Jul 12Pushed 9mo agoCompare

[ Source](https://github.com/karacweb/vcard)[ Packagist](https://packagist.org/packages/karacweb/vcard)[ RSS](/packages/karacweb-vcard/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (3)Versions (5)Used By (0)

Generate vcards fluently
========================

[](#generate-vcards-fluently)

[![Latest Stable Version](https://camo.githubusercontent.com/27f17d8cfbec00e564c964753331fe9439d4ad50d659686ea78b76b3cb4cbaf0/687474703a2f2f706f7365722e707567782e6f72672f6b617261637765622f76636172642f76)](https://packagist.org/packages/karacweb/vcard)[![Total Downloads](https://camo.githubusercontent.com/990ecae6d87230ea6bfd34970c2fbee8876361cba75d522ccb41b1aaed22dfa0/687474703a2f2f706f7365722e707567782e6f72672f6b617261637765622f76636172642f646f776e6c6f616473)](https://packagist.org/packages/karacweb/vcard)[![Latest Unstable Version](https://camo.githubusercontent.com/763be80af011441144cb4894070f3c30a04037dcb4d6aade2f6e683170a650e9/687474703a2f2f706f7365722e707567782e6f72672f6b617261637765622f76636172642f762f756e737461626c65)](https://packagist.org/packages/karacweb/vcard)[![License](https://camo.githubusercontent.com/daa064a94fca6b961786893a884c70dde9839f3a7a8579e0518815301c07ee40/687474703a2f2f706f7365722e707567782e6f72672f6b617261637765622f76636172642f6c6963656e7365)](https://packagist.org/packages/karacweb/vcard)[![PHP Version Require](https://camo.githubusercontent.com/75911697c12c036905e22894c958ed2d44384faf2b227208f93882f2e68f2e31/687474703a2f2f706f7365722e707567782e6f72672f6b617261637765622f76636172642f726571756972652f706870)](https://packagist.org/packages/karacweb/vcard)

This PHP packages allows you to create VCards files `.vcf`. This package uses the [Sabre VObject library](https://sabre.io/vobject/vcard/).

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require karacweb/vcard

```

Usage
-----

[](#usage)

```
use Karacweb\VCard\VCard;

$vcard = new VCard();

// The common name is mandatory
$vcard->setCommonName('John Smith');

$vcard->setFamilyNames('Smith');
$vcard->setFamilyNames(['Ferreira', 'Dos Santos', 'Silva']); // Accepts also an array

$vcard->setGivenNames('Nelson');
$vcard->setGivenNames(['Nelson', 'Francis']); // Accepts also an array

$vcard->setAdditionalNames('Francesco');
$vcard->setAdditionalNames(['Francesco', 'Luis']); // Accepts also an array

$vcard->setHonorificPrefixes('Mrs');
$vcard->setHonorificPrefixes(['Mr', 'President']); // Accepts also an array

$vcard->setHonorificSuffixes('Ph.D.');
$vcard->setHonorificSuffixes(['Ph.D.', 'M.D.']); // Accepts also an array

$vcard->setBirthday('1992-12-24'); // Y-m-d

$vcard->addOrg('ACME Inc.');

$vcard->addTitle('Software Engineer');

$vcard->addRole('Project Leader');

$vcard->addTel('+1-418-262-6501', true, ['CELL']);
$vcard->addTel('+1-418-656-9254', true, ['HOME']);

$vcard->addEmail('john.smith@acme.org');

$vcard->addUrl('https://karac.ch');

$vcard->addAdr('PO BOX 123', 'Extended address', '123, Acme Str', 'Acme City', 'Acme Region', 'ZIP 12345', 'Switzerland');
// With named arguments
$vcard->addAdr(street: '123, Acme Str', locality: 'Acme City', region: 'Acme Region', postalCode: 'ZIP 12345');

// Build the VCard
$vcard->serialize();

// Download the VCard in pure PHP
header('Content-Type: text/x-vcard; charset=utf-8');
header('Content-Disposition: attachment; filename=my-vcard.vcf');
echo $vcard->serialize();
return;

// Alternative with Laravel
return response()->make($vcard->serialize())
    ->header('Content-Type', 'text/x-vcard; charset=utf-8')
    ->header('Content-Disposition', 'attachment; filename=my-vcard.vcf');
```

In case you need to access the underlying Sabre VCard Object, use the following method:

```
use Karacweb\VCard\VCard;

$vcard = new VCard();

[...]

$sabreVCard = $vcard->getVCard();
```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance56

Moderate activity, may be stable

Popularity12

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~7 days

Total

4

Last Release

289d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8b70dca4d45fe5f427c2a10810c643723aabe33af789ea9578acfb9de0955e42?d=identicon)[apiaget](/maintainers/apiaget)

---

Top Contributors

[![apiaget](https://avatars.githubusercontent.com/u/634083?v=4)](https://github.com/apiaget "apiaget (9 commits)")

---

Tags

phpvcard

###  Code Quality

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/karacweb-vcard/health.svg)

```
[![Health](https://phpackages.com/badges/karacweb-vcard/health.svg)](https://phpackages.com/packages/karacweb-vcard)
```

###  Alternatives

[illuminate/support

The Illuminate Support package.

582107.1M34.5k](/packages/illuminate-support)[pragmarx/countries

PHP Countries and Currencies

1.9k3.3M18](/packages/pragmarx-countries)[illuminate/events

The Illuminate Events package.

13454.3M1.8k](/packages/illuminate-events)[illuminate/config

The Illuminate Config package.

10842.7M2.2k](/packages/illuminate-config)[illuminate/session

The Illuminate Session package.

9937.4M753](/packages/illuminate-session)[illuminate/pagination

The Illuminate Pagination package.

10532.5M862](/packages/illuminate-pagination)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
