Skip to content

Let admins preview unpublished course content in the dashboard#441

Merged
simonhamp merged 1 commit into
mainfrom
admin-course-preview
Jul 23, 2026
Merged

Let admins preview unpublished course content in the dashboard#441
simonhamp merged 1 commit into
mainfrom
admin-course-preview

Conversation

@simonhamp

Copy link
Copy Markdown
Member

What

Admins (per FILAMENT_USERS) can now see the full course content in the Dashboard → Course section regardless of published state:

  • The course, its modules, and lessons are no longer filtered by is_published for admins — on the course index, the lesson page sidebar, and prev/next navigation.
  • Admins bypass the purchase gate, so they can open any lesson (including Pro) to preview it.
  • Unpublished items are marked with an amber Draft badge (module list, lesson header, and module sidebar) so it's clear what customers can't see yet.
  • The dashboard course heading is now The NativePHP Masterclass (was "Course" with a subheading).

Why

Course content is being produced and published incrementally. Admins need to preview draft modules and lessons in the real customer-facing UI before flipping them live.

Also

  • Unpublished lessons now return a 404 for non-admins. Previously anyone with the slug could load an unpublished lesson directly, even though it was hidden from the listing.

Tests

4 new tests in CourseContentTest covering: admin sees unpublished content, non-admin owners still don't, admin can open an unpublished Pro lesson without purchase, and unpublished lessons 404 for non-admins. Full file (19 tests) plus CoursePageTest and HomeCourseCardTest pass.

🤖 Generated with Claude Code

- Admins see the course, modules and lessons regardless of published state,
  with amber Draft badges marking unpublished items
- Admins bypass the purchase gate so they can preview Pro lessons
- Unpublished lessons now 404 for non-admins (previously accessible by slug)
- Dashboard course heading is now 'The NativePHP Masterclass'

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@simonhamp
simonhamp marked this pull request as ready for review July 23, 2026 18:01
@simonhamp
simonhamp merged commit 60c3945 into main Jul 23, 2026
2 checks passed
@simonhamp
simonhamp deleted the admin-course-preview branch July 23, 2026 18:02
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