›
›
›
  1. docs
  2. ›
  3. byrcsc/laravel-checklist
1.x
Browse documentationOpenClose

Getting started

  • Introduction
  • Installation and setup
  • Quick start

Core concepts

  • Templates and versions
  • Items and sections
  • Checklist lifecycle
  • Answers and evidence
  • Conditional rules
  • Scoring
  • Recurring schedules
  • Audit history

Operations

  • Author a template
  • Run a checklist
  • Create a schedule
  • Customize notifications
  • Export and report
  • Verify audit history
  • Composing with sibling packages

Reference

  • Configuration
  • Builder API
  • Models and scopes
  • Events and notifications
  • Console commands
  • Enums and contracts
  • Testing
  • Troubleshooting

Getting started

  • Introduction
  • Installation and setup
  • Quick start

Core concepts

  • Templates and versions
  • Items and sections
  • Checklist lifecycle
  • Answers and evidence
  • Conditional rules
  • Scoring
  • Recurring schedules
  • Audit history

Operations

  • Author a template
  • Run a checklist
  • Create a schedule
  • Customize notifications
  • Export and report
  • Verify audit history
  • Composing with sibling packages

Reference

  • Configuration
  • Builder API
  • Models and scopes
  • Events and notifications
  • Console commands
  • Enums and contracts
  • Testing
  • Troubleshooting

byrcsc/laravel-checklist · 1.x

Create a schedule.

Persist a recurring checklist schedule and run its generator through Laravel's scheduler.

A Schedule creates future checklists from one template. Add one when the work must recur without an operator starting every checklist by hand.

1. Create the schedule model

use ByRcsc\LaravelChecklist\Enums\Frequency;
use ByRcsc\LaravelChecklist\Enums\OverlapPolicy;
use ByRcsc\LaravelChecklist\Models\Schedule as ChecklistSchedule;

$schedule = new ChecklistSchedule([
    'template_id' => $template->id,
    'frequency' => Frequency::Weekly,
    'day_of_week' => 1, // Monday, using Carbon's 0 to 6 convention
    'timezone' => 'Australia/Brisbane',
    'next_due_at' => now('Australia/Brisbane')
        ->next('Monday')
        ->setTime(6, 0)
        ->utc(),
    'overlap_policy' => OverlapPolicy::SkipWhileOpen,
    'active' => true,
]);

$schedule->subject()->associate($vehicle);
$schedule->assignee()->associate($driver);
$schedule->save();

The assignee and subject are optional polymorphic relations. The schedule copies them onto each generated checklist.

2. Set the frequency-specific field

For weekly schedules, set day_of_week from 0 for Sunday through 6 for Saturday. If omitted, the model derives it from next_due_at when saved.

For monthly schedules, set day_of_month from 1 through 31. If omitted, the model derives the day from next_due_at.

For every-N-days schedules, set a positive n_days. A zero or missing value is treated as one day by the recurrence calculation, but application validation should reject that ambiguous input.

Daily schedules need no supporting field.

3. Register the generator

use Illuminate\Support\Facades\Schedule;

Schedule::command('checklist:generate-due')->everyFifteenMinutes();

The command creates due instances, advances schedules, and then announces due-soon and overdue checklists. Schedule Laravel's scheduler process in the normal way for the deployment environment.

4. Choose the overlap policy

Use AlwaysCreate when every occurrence must exist even if earlier work is unfinished.

Use SkipWhileOpen when only one pending or in-progress checklist should exist for this schedule. A skipped occurrence still advances to the next due time.

5. Pause or resume generation

$schedule->update(['active' => false]);
$schedule->update(['active' => true]);

Inactive schedules are ignored. A null next_due_at is also ignored. Set a future or past due time when resuming.

What to read next

  • Recurring schedules for catch-up, timezone, and concurrency behavior.
  • Console commands for generator output.
  • Configuration to change the due-soon lead time.
PreviousRun a checklistNextCustomize notifications
View source

On this page

  1. 1. Create the schedule model
  2. 2. Set the frequency-specific field
  3. 3. Register the generator
  4. 4. Choose the overlap policy
  5. 5. Pause or resume generation
  6. What to read next