Download the PHP package developerabod/laravel-contact-exporter without Composer
On this page you can find all versions of the php package developerabod/laravel-contact-exporter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download developerabod/laravel-contact-exporter
More information about developerabod/laravel-contact-exporter
Files in developerabod/laravel-contact-exporter
Package laravel-contact-exporter
Short Description A Laravel package to efficiently manage and export contacts as vCard (.vcf) files.
License MIT
Informations about the package laravel-contact-exporter
✨ Features
- 📱 Export contacts as a
.vcffile ready to import on any smartphone - 🌍 Full Arabic name support with UTF-8 charset
- 🚀 Chunked database reading — memory-safe with millions of records
- 🔌 Works with both Eloquent Models and
DB::tablequeries - 🧩 Clean Fluent API — intuitive and expressive
- ⚙️ Fully configurable without touching the package source code
📦 Installation
Step 1 — Install via Composer
Step 2 — Publish the Config File
This creates the file: config/vcard-exporter.php
⚙️ Configuration
Open config/vcard-exporter.php and map each config key to the actual column name in your database table:
Note:
last_nameandwithLastName()andwithEmail()on theVCardfacade — no config changes needed.
🚀 Usage
Simplest Case — Relies entirely on config
With Last Name
With Email
With Both Last Name and Email
Different Table (overrides config)
Override Column Mapping (without changing config)
With WHERE Conditions
Note:
where()only works when usingfrom(). Do not combine it withfromQuery().
From an Eloquent Model
Important: When using
fromQuery(), apply all conditions directly to the query before passing it in. Do not chainwhere()on the VCard facade alongsidefromQuery().
From a DB::table Query
Custom Filename
Full Control — All Options Combined
📋 Configuration Reference
| Option | Description | Default |
|---|---|---|
table |
Database table name | contacts |
filename |
Output filename without .vcf extension |
contacts |
append_count |
Append the total record count to the filename | true |
append_date |
Append today's date to the filename | false |
skip_empty_phone |
Skip records that have no phone number | true |
normalize_phone |
Strip symbols and formatting from phone numbers | true |
charset_utf8 |
Enable UTF-8 charset for Arabic name support | true |
chunk_size |
Number of records to process per chunk | 500 |
📖 API Reference
| Method | Description |
|---|---|
from(string $table) |
Set the database table to query |
fromQuery($query) |
Pass in a ready-made Eloquent or DB::table query builder |
map(array $columns) |
Override the column mapping at runtime |
where(array $conditions) |
Add WHERE conditions (only works with from()) |
withLastName() |
Enable the last name field |
withEmail() |
Enable the email field |
filename(string $name) |
Set a custom output filename |
chunkSize(int $size) |
Override the chunk size for this export |
download(?string $filename) |
Execute the export and stream the .vcf file |
🏗️ Package Structure
📋 Requirements
| Requirement | Version |
|---|---|
| PHP | ^8.3 |
| Laravel | ^10 \| ^11 \| ^12 |
📄 License
Open source, released under the MIT License.
All versions of laravel-contact-exporter with dependencies
illuminate/support Version ^10|^11|^12
illuminate/database Version ^10|^11|^12