›
byrcsc/laravel-checklist · 1.x
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.
| Enum | Cases and values |
|---|---|
ChecklistStatus | Pending = pending, InProgress = in_progress, Completed = completed, Reviewed = reviewed |
TemplateVersionStatus | Draft = draft, Published = published |
ItemType | Checkbox = checkbox, YesNo = yes_no, PassFail = pass_fail, Text = text, Number = number, Rating = rating, Date = date, Select = select |
EvidenceType | Photo = photo, File = file, Signature = signature |
RuleOperator | Equals = equals, In = in, Below = below, Above = above |
RuleEffect | RequireEvidence = require_evidence, RequireNote = require_note, Show = show, Hide = hide |
Frequency | Daily = daily, Weekly = weekly, Monthly = monthly, EveryNDays = every_n_days |
OverlapPolicy | AlwaysCreate = always_create, SkipWhileOpen = skip_while_open |
ActionType | Created, 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.
interface RecipientResolver
{
public function resolve(
string $event,
Checklist $checklist,
): iterable;
}Return Laravel-notifiable objects. Configure the implementing class at
checklist.notifications.recipient_resolver.
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.
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.
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.