BlogPro — a better blog for Paymenter

BlogPro v1.0.0 is a Paymenter "Other" extension that adds a full blog to the storefront: Markdown posts, a card archive, category and tag pages, a sticky-TOC reading view, per-post SEO, scheduling, and view counting — plus a publishing UI that is genuinely pleasant to use on a tablet: a visual editor, true live preview in the real storefront theme, cover-image upload, auto-slug, draft autosave, an SEO panel with a live search-result preview, and a post list built for triage.

It is feature-compatible with the free "Blogs for Paymenter" by BuiltByBits v2.3.0 (same public routes and behavior, content stays Markdown), with a one-click importer for that extension's posts.

Install

  1. Copy this folder to Paymenter's extensions directory as extensions/Others/BlogPro/ (the folder name must be BlogPro).
  2. In the Paymenter admin panel, go to Extensions → Available Extensions, find BlogPro, and click Install. Installing runs the migrations and registers the routes, permissions, and admin pages.
  3. Visit /blog. To get the archive into the storefront navigation, add a Blog link to /blog in your theme's menu (the extension does not edit any theme files).

Uninstalling rolls the migrations back (drops the blogpro_* tables).

What you get

Area Details
Public /blog archive (featured first, 9 per page), /blog/category/{slug}, /blog/tag/{slug}, /blog/{slug} reading view with hero banner, sticky table of contents, prev/next, /blog/sitemap.xml, signed draft preview /blog/preview/{post} (admin only, 30 min)
Admin Blog → Posts (status filter, quick actions, bulk publish/unpublish/delete), Blog → Categories, Blog → Tags, Blog → Settings
Editor Markdown editor with toolbar + image attachments, title autoslug with duplicate warning, cover upload/pick/URL + alt text, description, categories + tags pickers (create inline), publish scheduling with a plain-language summary, SEO title/description with character counts and a Google-style preview, word count + reading time, featured toggle, draft autosave + unsaved-changes guard
Importer One click in Blog → Settings copies posts + tags from the free "Blogs for Paymenter" extension if it is installed (its tables are detected first; the button only appears then). Slugs are preserved; duplicates are skipped; safe to run twice

Settings (Admin → Blog → Settings)

  • Blog title — shown in the archive header (default: Blog)
  • Blog description — short line under the title
  • Posts per page — archive page size (default: 9)
  • Default OG image — fallback og:image for posts without a cover

Permissions

BlogPro registers four admin permissions, granted to the admin role on install:

  • admin.blog.view — see the Blog section
  • admin.blog.create — create posts, categories, tags
  • admin.blog.edit — edit posts, categories, tags
  • admin.blog.delete — delete posts, categories, tags
  • admin.blog.settings — change settings and run the importer

Content rules (what the editor does with your Markdown)

  • Content is stored as Markdown and rendered to HTML on the post page with league/commonmark (already in Paymenter's vendor tree) and sanitized with Laravel's Str::markdown()->sanitizeHtml(). Raw <script> and similar tags are stripped.
  • Heading anchors are generated from the heading text (Getting started → #getting-started); duplicates get -2, -3, … — that is what the sticky table of contents links to.
  • A post's status is derived, never stored separately: Draft (not published), Scheduled (publish date in the future), Published (publish date now or past). Unpublishing sets the publish date to null.
  • A view is counted once per browser session per post.

Editor notes (the parts that differ from a plain Filament form)

  • Visual editor: Filament 5's MarkdownEditor is EasyMDE/CodeMirror-based, not TipTap — it is the only Markdown-native editor shipped with the stack, and it keeps the Markdown-storage invariant (a true TipTap WYSIWYG stores HTML and would need an HTML→Markdown converter that is not in Paymenter's vendor tree). The editor has a toolbar, a side-by-side preview mode, and image attachments to public/blog.
  • Live preview: the Preview action opens the real public post page in a new tab — the actual storefront theme, not a mock. For an unsaved draft it opens the signed preview URL (/blog/preview/{id}); for a published post it opens the public URL.
  • Autosave: typing in the title or body (debounced) writes a draft copy to the browser session — never to the database record. Reopening the editor restores the newer session draft and says so. Saving clears it. Navigating away with unsaved changes shows the browser's leave-page warning.
  • SEO preview: the search-result preview in the SEO panel is a static preview for the current title/description; it does not fetch Google.

Files

BlogPro.php                    Extension entry point (routes, views, Livewire,
                               permissions, install/upgrade/uninstall)
routes/web.php                 /blog, /blog/category/{slug}, /blog/tag/{slug},
                               /blog/sitemap.xml, /blog/preview/{post},
                               /blog/{slug}
database/migrations/           4 migrations — blogpro_categories, blogpro_tags,
                               blogpro_posts, blogpro_post_tag / blogpro_post_category
Src/Models/                    BlogPost, BlogCategory, BlogTag
Src/Markdown.php               Render (CommonMark + sanitize), heading ids + TOC,
                               word count, reading time, plain text
Src/Slug.php                   Slugify, uniqueness, reserved slugs
Src/BlogSettings.php           Reads/writes the extension's Setting rows
Src/Livewire/                  BlogArchive, BlogPostPage
Src/Http/BlogController.php    sitemap.xml + signed draft preview
Src/Policies/BlogPolicy.php    One policy for all three models
Src/Importer/FreeBlogImporter.php  Import from the free extension's tables
Src/Filament/Concerns/AutosavesDrafts.php  Session autosave + restore
Admin/Resources/               BlogPostResource (+ List/Create/Edit),
                               BlogCategoryResource, BlogTagResource
Admin/Pages/BlogSettings.php   Settings page + import button
resources/views/               archive, post-card, show, sitemap,
                               admin/seo-preview
tests/blogpro_harness.php      Pure-PHP test harness (see below)

Tests

php tests/blogpro_harness.php   # exit 0 = all checks passed

The harness is pure PHP — no Laravel boot, no database, no network. It tests the slug helpers, the Markdown text helpers, php -l on every PHP file, Blade directive balance on every view, and that the routes, migrations, and wiring are all present. The CommonMark render checks and the heading/TOC checks need league/commonmark and php-xml (DOMDocument); on a machine without them they skip with a note and are covered by the live proof instead. On the Paymenter host both are available.

Live proof checklist (run after install)

  1. /blog loads as the archive (dark theme, cards, featured first).
  2. Create a post in admin: title autoslug works, duplicate slug warns, cover upload + alt text save, SEO panel counts and preview update, publish date in the future shows Scheduled, then publish it.
  3. Open the post: hero banner, sticky TOC links jump to headings, prev/next work, view count increments once per session.
  4. /blog/category/{slug}, /blog/tag/{slug}, /blog/sitemap.xml all load.
  5. Edit a published post, type a change, leave without saving: the browser warns. Reopen: the session draft restores with a notice.
  6. Uninstall + reinstall: tables drop and recreate cleanly.

v1 limits (known, by design)

  • No comments, no newsletter, no related posts, no author profiles, no WordPress import, no share row on posts.
  • Cover images: upload to public/blog, pick an existing file, or paste a URL. There is no media library beyond the picker's list.
  • The SEO preview is a static mock of a search result, not live data.
  • Posts are Markdown; there is no block-based WYSIWYG editor (see "Editor notes" above).
  • The importer copies posts and tags only; the free extension has no categories, so there is nothing to import for them.
S
Description
BlogPro — a better blog extension for Paymenter: visual Markdown publishing, categories, tags, SEO, scheduling.
Readme
218 KiB
0 Stars 1 Watchers 0 Forks
Languages
PHP 90.7%
Blade 9.3%