spatie/calendar-links
Composer 安装命令:
composer require spatie/calendar-links
包简介
Generate add to calendar links for Google, iCal and other calendar systems
关键字:
README 文档
README
Using this package, you can generate links to add events to calendar systems. Here's a quick example:
use Spatie\CalendarLinks\Link; Link::create( 'Birthday', DateTime::createFromFormat('Y-m-d H:i', '2018-02-01 09:00'), DateTime::createFromFormat('Y-m-d H:i', '2018-02-01 18:00') )->google();
This will output: https://calendar.google.com/calendar/render?action=TEMPLATE&text=Birthday&dates=20180201T090000/20180201T180000&sprop=&sprop=name:
If you follow that link (and are authenticated with Google), you’ll see a screen to add the event to your calendar.
The package can also generate ics files that you can open in several email and calendar programs, including Microsoft Outlook, Google Calendar, and Apple Calendar.
Support us
We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products.
We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall.
Installation
You can install the package via composer:
composer require spatie/calendar-links
Usage
<?php use Spatie\CalendarLinks\Link; $from = DateTime::createFromFormat('Y-m-d H:i', '2018-02-01 09:00'); $to = DateTime::createFromFormat('Y-m-d H:i', '2018-02-01 18:00'); $link = Link::create('Sebastian’s birthday', $from, $to) ->description('Cookies & cocktails!') ->address('Kruikstraat 22, 2018 Antwerpen'); // Generate a link to create an event on Google calendar echo $link->google(); // Generate a link to create an event on Yahoo calendar echo $link->yahoo(); // Generate a link to create an event on outlook.live.com calendar echo $link->webOutlook(); // Generate a link to create an event on outlook.cloud.microsoft calendar echo $link->webOffice(); // Generate a data URI for an ics file (for iCal & Outlook) echo $link->ics(); echo $link->ics(['UID' => 'custom-id']); // Custom UID (to update existing events) echo $link->ics(['URL' => 'https://my-page.com']); // Custom URL echo $link->ics(['REMINDER' => []]); // Add the default reminder (for iCal & Outlook) echo $link->ics(['REMINDER' => ['DESCRIPTION' => 'Remind me', 'TIME' => new \DateTime('tomorrow 12:30 UTC')]]); // Add a custom reminder echo $link->ics([], ['format' => 'file']); // use file output; e.g. to attach ics as a file to an email. // Generate a data URI using arbitrary generator: echo $link->formatWith(new \Your\Generator());
Package principles
- it should produce a small output (to keep page-size small)
- it should be fast (no any external heavy dependencies)
- all
Linkclass features should be supported by at least 2 generators (different services have different features)
Changelog
Please see CHANGELOG for more information.
Testing
composer test
Contributing
Please see CONTRIBUTING for details.
Security
If you've found a bug regarding security, please mail security@spatie.be instead of using the issue tracker.
Postcardware
You're free to use this package (it's MIT-licensed), but if it makes it to your production environment, we highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using.
Our address is: Spatie, Samberstraat 69D, 2060 Antwerp, Belgium.
We publish all received postcards on our company website.
Credits
License
The MIT License (MIT). Please see License File for more information.
spatie/calendar-links 适用场景与选型建议
spatie/calendar-links 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 7.69M 次下载、GitHub Stars 达 1.01k, 最近一次更新时间为 2017 年 09 月 17 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「spatie」 「calendar-links」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 spatie/calendar-links 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 spatie/calendar-links 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 spatie/calendar-links 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Generate add to calendar links for Google, iCal and other calendar systems
Receive webhooks in Laravel apps
Generate add to calendar links for Google, iCal and other calendar systems
Easily optimize images using PHP
Store your application settings
Generate add to calendar links for Google, iCal and other calendar systems
统计信息
- 总下载量: 7.69M
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1021
- 点击次数: 18
- 依赖项目数: 11
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-09-17