2017 © Pedro Peláez
 

library laravel-recurring

simshaun/recurr integration for Laravel/Eloquent.

image

houseoftech/laravel-recurring

simshaun/recurr integration for Laravel/Eloquent.

  • Monday, July 16, 2018
  • by houseoftech
  • Repository
  • 1 Watchers
  • 0 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 7 Forks
  • 0 Open issues
  • 14 Versions
  • 0 % Grown

The README.md

Laravel Recurring

Installation

Require this package, with Composer, in the root directory of your project., (*1)

``` bash $ composer require houseoftech/laravel-recurring, (*2)


Note: If using with Laravel 5.x, require version 1. ``` bash $ composer require houseoftech/laravel-recurring:1.5.3

This package includes a publishable asset. Publishing will copy the config to your project so it can be modified., (*3)

$ php artisan vendor:publish

The config file can be found at config/laravel-recurring.php., (*4)

Usage

``` php <?php, (*5)

namespace App;, (*6)

use BrianFaust\LaravelRecurring\Traits\RecurringTrait; use Illuminate\Database\Eloquent\Model;, (*7)

class Task extends Model { use RecurringTrait; }, (*8)


```php Route::get('/', function () { $task = App\Task::first(); $task->recurr()->first(); $task->recurr()->last(); $task->recurr()->next(); $task->recurr()->current(); $task->recurr()->rule(); $task->recurr()->schedule(); });

Examples

    $task = new App\Task();

    $task->start_at = '2017/1/1';

    $task->until = '2017/12/12';

    $task->by_day = 'MO,FR';

    $task->frequency = 'WEEKLY';

    $task->timezone = 'Europe/Amsterdam';

    $start = new DateTime('2017/5/5');

    $end = new DateTime('2017/5/15');

    print_r($task->recurr()->scheduleBetween($start, $end));

    // Using exceptions and inclusions

    $task->exceptions = ['2017/05/08'];

    $task->inclusions = ['2017/05/10', '2017/05/11'];

    print_r($task->recurr()->scheduleBetween($start, $end));

Exceptions and inclusions can be passed as a single date string, an array of date strings, or as an Eloquent\Collection. The value will be plucked from the date column., (*9)

Example exceptions migration, (*10)

    Schema::create('exceptions', function (Blueprint $table) {
        $table->increments('id');
        $table->integer('event_id')->unsigned();
        $table->datetime('date');
        $table->timestamps();
    });

Assuming Task model has a hasMany relation to Exception, e.g., (*11)

    public function exceptions()
    {
        return $this->hasMany(Exception::class);
    }

The exceptions can be passed to recurr directly., (*12)

    $task = App\Task::with('exceptions')->find(1);

    print_r($task->recurr()->schedule());

Testing

bash $ phpunit, (*13)

Security

If you discover a security vulnerability within this package, please send an e-mail to Brian Faust at hello@brianfaust.me. All security vulnerabilities will be promptly addressed., (*14)

Credits

License

MIT © Brian Faust, (*15)

The Versions

16/07 2018

dev-master

9999999-dev

simshaun/recurr integration for Laravel/Eloquent.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Corie Slate

laravel framework laravel-recurring laravel recurring

16/07 2018

1.5.1

1.5.1.0

simshaun/recurr integration for Laravel/Eloquent.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Corie Slate

laravel framework laravel-recurring laravel recurring

16/07 2018

1.5

1.5.0.0

simshaun/recurr integration for Laravel/Eloquent.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Corie Slate

laravel framework laravel-recurring laravel recurring

13/11 2017

dev-update/schedule-between-performance

dev-update/schedule-between-performance

simshaun/recurr integration for Laravel/Eloquent.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel framework brian faust faustbrian laravel-recurring laravel recurring

02/11 2017

dev-feature-exceptions-inclusions

dev-feature-exceptions-inclusions

simshaun/recurr integration for Laravel/Eloquent.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel framework brian faust faustbrian laravel-recurring laravel recurring

31/07 2017

1.4.0

1.4.0.0

simshaun/recurr integration for Laravel/Eloquent.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel framework brian faust faustbrian laravel-recurring laravel recurring

30/06 2017

1.3.1

1.3.1.0

simshaun/recurr integration for Laravel/Eloquent.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel framework brian faust faustbrian laravel-recurring laravel recurring

22/06 2017

1.3.0

1.3.0.0

simshaun/recurr integration for Laravel/Eloquent.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel framework brian faust faustbrian laravel-recurring laravel recurring

20/01 2017

1.2.0

1.2.0.0

simshaun/recurr integration for Laravel/Eloquent.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel framework brian faust faustbrian laravel-recurring laravel recurring

11/01 2017

1.1.2

1.1.2.0

simshaun/recurr integration for Laravel/Eloquent.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel framework brian faust faustbrian laravel-recurring laravel recurring

11/01 2017

1.1.1

1.1.1.0

simshaun/recurr integration for Laravel/Eloquent.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel framework brian faust faustbrian laravel-recurring laravel recurring

11/01 2017

1.1.0

1.1.0.0

simshaun/recurr integration for Laravel/Eloquent.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel framework brian faust faustbrian laravel-recurring laravel recurring

24/11 2016

1.0.1

1.0.1.0

simshaun/recurr integration for Laravel/Eloquent.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel framework brian faust faustbrian laravel-recurring laravel recurring

24/11 2016

1.0.0

1.0.0.0

simshaun/recurr integration for Laravel/Eloquent.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel framework brian faust faustbrian laravel-recurring laravel recurring