Skip to content

Require course certificate templates - #126

Merged
johnwesely merged 9 commits into
4.xfrom
lms-certificate-builder-CU-868m0zvvx
Sep 18, 2026
Merged

johnwesely merged 9 commits into
4.xfrom
lms-certificate-builder-CU-868m0zvvx

Conversation

@johnwesely

@johnwesely johnwesely commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Course certificates are builder-only. lms_courses.award is dropped after every course is assigned a living certificate_template_id.
  • php artisan filament-lms:upgrade-awards (--dry-run, --force, --award=, --dump=) converts award Blades to templates. filament-lms:migrate-awards-to-templates is a hidden alias.
  • php artisan migrate runs drop_award_from_lms_courses_table: backfill, require the FK (restrictOnDelete), drop award.
  • Courses without a template 404. New courses and SCORM imports default to Default Certificate.
  • See UPGRADING.md.

Test plan

  • php artisan filament-lms:upgrade-awards --dry-run
  • php artisan migrate
  • Confirm every course has a template and award is gone
  • Edit Course: template select is required; Create stays available
  • Certificate show/download uses the builder view
  • --force refreshes {Label} Certificate layouts only and does not retarget custom templates

Note

High Risk
Breaking schema and certificate rendering path; migrate depends on installing filament-certificate-builder and successful backfill before award is dropped.

Overview
Breaking change: course completion certificates no longer use per-course award Blade views or config('filament-lms.awards'). Courses now require a certificate_template_id tied to tapp/filament-certificate-builder, with new integrations.certificate_builder config and UPGRADING.md for the migration path.

Data & upgrade: migrations add certificate_template_id, then drop_award_from_lms_courses_table runs MigrateAwardsToCertificateTemplates (from legacy award Blades/config), enforces a non-null FK with restrictOnDelete, and drops award. filament-lms:upgrade-awards (--dry-run, --force, --award=, --dump=) previews or runs the conversion; a hidden alias remains for the old command name.

Runtime & admin: CertificateController renders the builder view with course/user token context and returns 404 when no template is assigned; CourseResource / Edit Course use a required template select plus create/edit template actions. New courses, factories, and SCORM imports default to Default Certificate. Certificate download on the completed page uses the filament-lms::certificates.download route.

Reviewed by Cursor Bugbot for commit 6b12c0f. Bugbot is set up for automated code reviews on this repo. Configure here.

John Wesely and others added 2 commits September 8, 2026 10:14
Hosts can assign a certificate-builder template per course
without making the builder a hard dependency. Award Blade
certificates stay the fallback.

Co-authored-by: Cursor <cursoragent@cursor.com>

@cursor cursor Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread src/Support/CertificateBuilder.php
Optional builder class-strings and EditRecord typing
tripped level 4 analysis.

Co-authored-by: Cursor <cursoragent@cursor.com>
John Wesely and others added 2 commits September 8, 2026 12:43
LMS ships no Course policy; Laravel denies update and hid
Create/Edit Certificate Template on Edit Course.

Co-authored-by: Cursor <cursoragent@cursor.com>
Hosts can convert existing LMS award certificates into
builder templates without waiting on pixel-perfect layouts.

Co-authored-by: Cursor <cursoragent@cursor.com>

@cursor cursor Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread src/Services/MigrateAwardsToCertificateTemplates.php Outdated
Award Blades become templates on upgrade, then award is dropped.
Hosts run filament-lms:upgrade-awards and migrate.

Co-authored-by: Cursor <cursoragent@cursor.com>
@johnwesely johnwesely changed the title Add optional course certificate templates Require course certificate templates Sep 11, 2026

@cursor cursor Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread src/Services/MigrateAwardsToCertificateTemplates.php Outdated
John Wesely and others added 2 commits September 18, 2026 10:49
Co-authored-by: Cursor <cursoragent@cursor.com>
Keep both the tenant-scoped unique course indexes from 4.x and the certificate template migrations from this branch.

Co-authored-by: Cursor <cursoragent@cursor.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 6b12c0f. Configure here.

Comment thread database/migrations/drop_award_from_lms_courses_table.php.stub
CSV import omitted certificate_template_id, and
award remigration queried the dropped column and
reused same-named templates from other token sets.

Co-authored-by: Cursor <cursoragent@cursor.com>
@johnwesely
johnwesely merged commit bcae0e1 into 4.x Sep 18, 2026
15 checks passed
@johnwesely
johnwesely deleted the lms-certificate-builder-CU-868m0zvvx branch September 18, 2026 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant