Skip to content

feat: full CMS module (pages, posts, media, menus)#54

Open
willard wants to merge 1 commit into
mainfrom
feature/cms
Open

feat: full CMS module (pages, posts, media, menus)#54
willard wants to merge 1 commit into
mainfrom
feature/cms

Conversation

@willard

@willard willard commented Apr 19, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds a full CMS module: static Pages, Blog Posts, Media Library, and admin-editable Navigation menus
  • Converts the product_tag pivot to a polymorphic taggables table so Products and Posts share the tag taxonomy
  • Tiptap rich-text editor wired into Page and Post forms with server-side sanitization via mews/purifier
  • Storefront gets /pages/{slug}, /blog, /blog/{slug} and a dynamic footer/header driven by the Menus admin

Backend

  • New models: Page, Post, Media, MenuItem
  • New enums: PublishStatus, PageTemplate, MenuLocation
  • New controllers (admin + storefront), Form Requests, Policies, Factories, Seeders
  • HandleInertiaRequests shares menus globally for the storefront
  • Permissions added for each resource (view/create/update/delete/publish)

Frontend

  • Admin pages: Pages, Posts, Media, Menus (Index/Create/Edit where applicable)
  • TiptapEditor.vue component with MediaPicker integration
  • Storefront blog index/show and page show
  • AppSidebar gains a Content section gated by the new permissions

Tests

  • 49 new PHPUnit feature tests covering happy paths, validation, authorization, sanitization, and the polymorphic tag regression
  • 14 new Vitest tests for the new admin pages
  • Full suite green: 792 PHPUnit, 483 Vitest, Pint pass, ESLint clean

Test plan

  • php artisan test --compact — full PHPUnit suite passes
  • npm run test:run — Vitest passes
  • vendor/bin/pint --test --format agent — style check
  • Log in as super-admin, create a Page via Tiptap, publish, confirm /pages/{slug} renders
  • Create a Post with a tag, confirm it appears on /blog and /blog/{slug}
  • Upload an image in Media, reuse it on a Page via the picker
  • Edit header/footer menu, confirm storefront updates
  • Regression: existing product with an existing tag still shows the tag

🤖 Generated with Claude Code

Adds a content management module so shop owners can publish static
pages, blog posts, media, and configure storefront navigation without
editing Vue files.

Backend
- Polymorphic `taggables` pivot shared by Products and Posts
- Static Pages with Tiptap rich-text bodies, SEO fields, templates
- Blog Posts with tag taxonomy, featured images, related posts
- Media Library with alt-text editing and file uploads
- Admin-editable header + footer menus, dynamic storefront rendering
- mews/purifier for server-side HTML sanitization
- New policies for Page, Post, Media, Menu with resource.action
  permissions; seeded for super-admin, admin, manager roles

Frontend
- Tiptap editor wrapper with MediaPicker integration
- Admin CRUD pages for Pages, Posts, Media, Menus
- Storefront `/pages/{slug}`, `/blog`, `/blog/{slug}` routes
- Dynamic footer + header from menus shared via Inertia middleware
- AppSidebar gains Content section gated by new permissions

Tests
- 49 new PHPUnit feature tests (pages, posts, media, menus,
  polymorphic tags regression, storefront scoping)
- 14 new Vitest admin page tests
- Full suite: 792 PHPUnit, 483 Vitest, Pint pass

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.

2 participants