2017 © Pedro Peláez
 

library laravel-rrule

A Laravel friendly package to manage date recurrence rules

image

jpmurray/laravel-rrule

A Laravel friendly package to manage date recurrence rules

  • Tuesday, August 23, 2016
  • by atomescrochus
  • Repository
  • 1 Watchers
  • 2 Stars
  • 603 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 7 Open issues
  • 7 Versions
  • 6 % Grown

The README.md

jpmurray/laravel-rrule

Latest Version on Packagist ![Software License][ico-license] StyleCI ![Total Downloads][ico-downloads], (*1)

A simple helper to generate date occurences more fluently, using simshaun/recurr., (*2)

Nota Bene

This is my first package. I actually built this to get to gain a bit more know-how about packages. It might be useful. It might not. It might be badly constructed. It might not. Honestly, I'll try to maintain and improve it over time, but please bear with me as it's been built more to learn that to be the perfect package., (*3)

And on that note: PRs are hapilly welcomed!, (*4)

Roadmap

Check this tag in the issues., (*5)

Install

Via Composer, (*6)

``` bash $ composer require jpmurray/laravel-rrule, (*7)


## Usage ``` php $recurrence = new Recurrence(); //of course, you can chain all those methods! $recurrence->setFrequency('weekly'); // Either one of `yearly`, `monthly`, `weekly`, `daily`, `hourly`, `minutly`, `secondly` $recurrence->setCount(20); // the number of occurences we want. Cannot be used with `setUntil()` $recurrence->setInterval(1); // every Nth time $recurrence->setStart(Carbon::parse('August 9th 2016 21:18:00')); // a carbon object for when to start the occurences $recurrence->setEnd(Carbon::parse('August 9th 2016 22:00:10')); // a carbon object for when to end the occurences $recurrence->setDays([ ['sunday', null], ['tuesday', -2], ['friday', 3], ]); // the first is the day of the occurence, the other is the position (eg: -2: second to last; 3: third; null: not set) $recurrence->setMonths([ 'january', 'march', 'october', 'december' ]); // months of the occurences $recurrence->setLang('fr'); // for output to text. Defaults to english. Accepts ISO 639-1 language codes $recurrence->setFrom(Carbon::now()->subMonth()); // calculate occurences from this date. $recurrence->setUntil(Carbon::now()->addMonths(2)); // calculate occurences until this date. Cannot be used with `setCount()` $recurrence->build(); //will save object and generate the outputs

Those next methods are not chainable:, (*8)

$recurrence->getToText(); // returns the `toText` value of current rules. eg: "weekly in January, March, October and December on the Sunday, 2nd to the last Tuesday and 3rd Friday for 5 times"
$recurrence->getOccurences(); // returns a collection of Carbon object for each occurence with current rules

Change log

Please see CHANGELOG for more information what has changed recently., (*9)

Testing

bash $ composer test, (*10)

Contributing

Please see CONTRIBUTING and CONDUCT for details., (*11)

Security

If you discover any security related issues, please email himself@jpmurray.net instead of using the issue tracker., (*12)

Credits

License

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

The Versions

23/08 2016
11/08 2016

3.2.0

3.2.0.0 https://github.com/jpmurray/laravel-rrule

A Laravel friendly package to manage date recurrence rules

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel package rrule jpmurray

10/08 2016

3.1.0

3.1.0.0 https://github.com/jpmurray/laravel-rrule

A Laravel friendly package to manage date recurrence rules

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel package rrule jpmurray

10/08 2016

3.0.0

3.0.0.0 https://github.com/jpmurray/laravel-rrule

A Laravel friendly package to manage date recurrence rules

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel package rrule jpmurray

10/08 2016

2.1.0

2.1.0.0 https://github.com/jpmurray/laravel-rrule

A Laravel friendly package to manage date recurrence rules

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel package rrule jpmurray

10/08 2016

2.0.0

2.0.0.0 https://github.com/jpmurray/laravel-rrule

A Laravel friendly package to manage date recurrence rules

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel package rrule jpmurray

10/08 2016

1.0.0

1.0.0.0 https://github.com/jpmurray/LaravelRrule

A Laravel friendly package to manage date recurrence rules

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel package rrule jpmurray laravelrrule