›
›
›
  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

Enums and contracts.

Reference backed enum values and the public interfaces available for application integration.

The package uses backed enums for stored state and typed method arguments. Implement RecipientResolver when you need to choose notification recipients. The remaining public contracts describe the shipped completion pipeline and item type handlers.

Backed enums

EnumCases and values
ChecklistStatusPending = pending, InProgress = in_progress, Completed = completed, Reviewed = reviewed
TemplateVersionStatusDraft = draft, Published = published
ItemTypeCheckbox = checkbox, YesNo = yes_no, PassFail = pass_fail, Text = text, Number = number, Rating = rating, Date = date, Select = select
EvidenceTypePhoto = photo, File = file, Signature = signature
RuleOperatorEquals = equals, In = in, Below = below, Above = above
RuleEffectRequireEvidence = require_evidence, RequireNote = require_note, Show = show, Hide = hide
FrequencyDaily = daily, Weekly = weekly, Monthly = monthly, EveryNDays = every_n_days
OverlapPolicyAlwaysCreate = always_create, SkipWhileOpen = skip_while_open
ActionTypeCreated, ScheduleGenerated, Assigned, Submitted, Reviewed, Reopened, AnswerGiven, AnswerChanged, NoteAdded, EvidenceAdded, EvidenceRemoved, VisibilityChanged with snake-case values

ChecklistStatus::acceptsAnswers() is true for pending and in-progress states. RuleEffect exposes isVisibility() and isRequirement(). RuleOperator::supports(ItemType $type) checks whether an operator is valid for an item type. ActionType::isItemLevel() distinguishes granular history rows.

Recipient resolver

interface RecipientResolver
{
    public function resolve(
        string $event,
        Checklist $checklist,
    ): iterable;
}

Return Laravel-notifiable objects. Configure the implementing class at checklist.notifications.recipient_resolver.

Completion pipeline contracts

interface CompletionCheck
{
    public function unmet(Checklist $checklist): array;
}

interface CompletionStep
{
    public function apply(Checklist $checklist): void;
}

The container singleton Execution\CompletionPipeline exposes check(CompletionCheck $check): self and step(CompletionStep $step): self. Shipped registration adds required-item and requirement-rule checks before the scoring step.

These interfaces are public, but the configuration file has no declarative list for extra checks or steps. Extend the singleton in an application service provider only when you control provider ordering and test the resulting pipeline.

Type handler contract

interface TypeHandler
{
    public function validate(mixed $value, Item $item): void;
    public function cast(mixed $value, Item $item): mixed;
    public function score(mixed $value, Item $item): ?float;
    public function isFailure(mixed $value, Item $item): bool;
    public function validateConfig(array $config, string $label): void;
}

Types\TypeRegistry::for(ItemType|string $type): TypeHandler returns a fresh shipped handler for each known item type.

The registry has no public registration method. Application-defined item types are not supported in v1 even though the contract is public.

Exception hierarchy

Catch Exceptions\ChecklistException for any package-domain failure. Specific final exceptions cover invalid answers, configuration, template validation, published structure, checklist state, incomplete submission, evidence, append-only actions, and rule evaluation.

What to read next

  • Builder API for enum-bearing rule method signatures.
  • Models and scopes for enum-cast attributes.
  • Customize notifications to implement the recipient resolver.
PreviousConsole commandsNextTesting
View source

On this page

  1. Backed enums
  2. Recipient resolver
  3. Completion pipeline contracts
  4. Type handler contract
  5. Exception hierarchy
  6. What to read next