PHP code example of starfolksoftware / redo
1. Go to this page and download the library: Download starfolksoftware/redo library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
starfolksoftware / redo example snippets
Redo::ignoreMigrations();
Redo::useRecurrenceModel('App\\Models\\CoolRecurrenceModel');
Redo::useTimezone('Continent/Country');
Redo::useRecurrencesTableName('new_table_name');
Redo::supportsSoftDeletes();
Redo::supportsTeams();
use StarfolkSoftware\Redo\Recurs;
class Task extends Model
{
// ...
use Recurs;
// ...
}
$task->makeRecurrable(string $frequency, int $interval, \DateTime $startsAt, $ends = null)
$task->updateRecurrence(string $frequency, int $interval, \DateTime $startsAt, $ends = null)
$task->pauseRecurrence(bool $value = true)
$task->recurrenceIsActive()
$task->recurrences(): \Recurr\RecurrenceCollection|\Recurr\Recurrence[]
// other useful methods
$task->currentRecurrence()
$task->nextRecurrence()
$task->firstRecurrence()
$task->lastRecurrence()
use StarfolkSoftware\Redo\TeamHasRecurrences;
class Team extends Model
{
use TeamHasRecurrences;
protected $table = 'teams';
}
$team->recurrences()->save([
//...
]);
$team->recurrences
bash
php artisan redo:install