定制 starfolksoftware/redo 二次开发

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

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

starfolksoftware/redo

最新稳定版本:v1.0.3

Composer 安装命令:

composer require starfolksoftware/redo

包简介

Make calendar events recurrable in your Laravel applications

README 文档

README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Make calendar events recurrable in your Laravel applications.

Installation

You can install the package via composer:

composer require starfolksoftware/redo

To install the package, run the following command:

php artisan redo:install

Configurations

To disable migrations, add the following in the service provider:

Redo::ignoreMigrations();

To use a different Recurrence model:

Redo::useRecurrenceModel('App\\Models\\CoolRecurrenceModel');

To specify the timezone Redo should use:

Redo::useTimezone('Continent/Country');

To specify the recurrences table name,

Redo::useRecurrencesTableName('new_table_name');

To turn on support for soft deletiong,

Redo::supportsSoftDeletes();

To turn on support for teams

Redo::supportsTeams();

Usage

To make a model recur, add the Recurs trait as in the following:

use StarfolkSoftware\Redo\Recurs;

class Task extends Model
{
    // ...
    use Recurs;
    // ...
}

To create a recurrence on a recur model,

$task->makeRecurrable(string $frequency, int $interval, \DateTime $startsAt, $ends = null)

To update a model's recurrence,

$task->updateRecurrence(string $frequency, int $interval, \DateTime $startsAt, $ends = null)

To pause a model's recurrence,

$task->pauseRecurrence(bool $value = true)

To check if a model's recurrence is active,

$task->recurrenceIsActive()

To return recurrences of a model,

$task->recurrences(): \Recurr\RecurrenceCollection|\Recurr\Recurrence[]

// other useful methods
$task->currentRecurrence()
$task->nextRecurrence()
$task->firstRecurrence()
$task->lastRecurrence()

To setup the team support, add the TeamHasRecurrences trait to the team model,

use StarfolkSoftware\Redo\TeamHasRecurrences;

class Team extends Model
{
    use TeamHasRecurrences;

    protected $table = 'teams';
}

To create a recurrence for a team,

$team->recurrences()->save([
    //...
]);

To fetch recurrences of a team,

$team->recurrences

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please recurrence our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-11-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固