elouafidev/vcf-generator
最新稳定版本:1.0.3
Composer 安装命令:
composer require elouafidev/vcf-generator
包简介
A simple VCF generator for Laravel.
README 文档
README
A simple VCF (vCard) generator for Laravel. This package provides an easy way to generate VCF files for contacts in your Laravel applications. It supports adding various contact details such as full name, email addresses, phone numbers, addresses, social media profiles, and more.
Installation
You can install the package via composer:
composer require elouafidev/vcf-generator
Usage
Here is a simple example of how to use the VCF generator in your Laravel project:
use ElouafiDev\VCFGenerator\VCFGenerator; $vcf = new VCFGenerator(); $vcf->setFullName('John Doe') ->setEmail('john.doe@example.com', VCFGenerator::WORK) ->setPhoneNumber('+123456789', VCFGenerator::WORK) ->setAddress('123 Main St, Anytown, USA') ->setTitle('Software Engineer') ->setDescription('Experienced software engineer with a passion for developing innovative programs.') ->setProfileImage150x150('/path/to/image.png') ->setFacebook('https://facebook.com/johndoe') ->setTwitter('https://twitter.com/johndoe') ->setLinkedin('https://linkedin.com/in/johndoe') ->setYoutube('https://youtube.com/johndoe') ->setInstagram('https://instagram.com/johndoe') ->setWebsite('https://johndoe.com') ->setSkype('johndoe'); return $vcf->download();
Methods
setFullName(string $full_name): selfsetEmail(string $email, string $type): selfsetPhoneNumber(string $phone, string $type): selfsetAddress(string $address): selfsetTitle(string $title): selfsetDescription(string $description): selfsetProfileImage150x150(string $profile_image_150x150): selfsetFacebook(string $url): selfsetTwitter(string $url): selfsetLinkedin(string $url): selfsetYoutube(string $url): selfsetInstagram(string $url): selfsetWebsite(string $url): selfsetSkype(string $url): selfvcfContent(): stringtoBase64(): stringtoUri(): stringdownload()validateEmail(string $email): boolvalidatePhoneNumber(string $phone): boolclear(): selfsetAttributes(array $attributes): self
Examples
Generate VCF Content
$vcfContent = $vcf->vcfContent(); echo $vcfContent;
Get VCF as Base64
$vcfBase64 = $vcf->toBase64(); echo $vcfBase64;
Get VCF as Data URI
$vcfUri = $vcf->toUri(); echo $vcfUri;
Contributing
Please see CONTRIBUTING for details.
License
The MIT License (MIT). Please see License File for more information.
Author
Mouad Elouafi
- Email: support@elouafi.dev
统计信息
- 总下载量: 11
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-05-26