定制 elouafidev/vcf-generator 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

elouafidev/vcf-generator

最新稳定版本:1.0.3

Composer 安装命令:

composer require elouafidev/vcf-generator

包简介

A simple VCF generator for Laravel.

README 文档

README

Latest Version on Packagist Total Downloads License

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): self
  • setEmail(string $email, string $type): self
  • setPhoneNumber(string $phone, string $type): self
  • setAddress(string $address): self
  • setTitle(string $title): self
  • setDescription(string $description): self
  • setProfileImage150x150(string $profile_image_150x150): self
  • setFacebook(string $url): self
  • setTwitter(string $url): self
  • setLinkedin(string $url): self
  • setYoutube(string $url): self
  • setInstagram(string $url): self
  • setWebsite(string $url): self
  • setSkype(string $url): self
  • vcfContent(): string
  • toBase64(): string
  • toUri(): string
  • download()
  • validateEmail(string $email): bool
  • validatePhoneNumber(string $phone): bool
  • clear(): self
  • setAttributes(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

统计信息

  • 总下载量: 13
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-05-26