Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Prezet Laravel Package

benbjurstrom/prezet

Prezet is a Laravel package for creating presentations from Markdown. Author slides in plain Markdown with front matter, then render them as polished, customizable HTML decks. Great for developer talks, internal docs, and sharing presentations directly from your Laravel app.

View on GitHub
Deep Wiki
Context7

Getting Started

  • Install with composer require benbjurstrom/prezet, then run php artisan prezet:install to publish config/prezet.php, migrations, and scaffold the content/ directory.
  • Run php artisan migrate to create the SQLite index table, then php artisan prezet:index to parse your markdown into it. The index is what the router queries — the filesystem alone is not enough.
  • Register the front-end routes by calling Prezet::routes() in routes/web.php (or publish the generated route file and wire it yourself if you need custom middleware).
  • First use case: drop a hello-world.md into content/ with front matter (title, date, excerpt, category, image, draft), re-run prezet:index, and hit /blog/hello-world. If you see a 404, the index has not been built or the slug does not match.
  • Look first at config/prezet.php — route prefix, content path, database connection, and image handling are all there. That is the file you will edit most.

Implementation Patterns

  • Authoring loop: markdown edit → prezet:index → refresh. Wire prezet:index into a watch script (or a small file-system listener) so drafts preview without manual indexing. prezet:update (if present in your version) is the incremental counterpart to a full re-index.
  • Deploy pipeline: the SQLite index must exist on the target host. Either commit the built index, run php artisan prezet:index as a post-deploy step, or generate it in your deploy script after composer install. Do not assume the local index ships with the code.
  • Blade rendering: the package ships a prezet::prose (and layout) Blade component that wraps parsed HTML with typography styles. Publish the views (prezet:install --views or vendor:publish) and override them when you need custom markup around articles, or a different layout entirely.
  • Listing/filtering: query BenBjurstrom\Prezet\Models\Document directly in controllers to build category, tag, or date-archive pages. The model carries front matter fields (title, category, date, excerpt, draft) so you avoid parsing markdown twice.
  • Images: the prezet:image command processes images referenced from front matter or markdown and stores derivatives keyed to content. Keep image paths relative to the content directory so they resolve on both local and prod.
  • Sitemap: v1.4.0 updates the sitemap integration. If you generate a sitemap via Spatie's package or a custom controller, call the Prezet sitemap source after prezet:index in the same deploy step — otherwise new posts are missing from the map.
  • Laravel Boost skill (v1.4.0): if you use Laravel Boost, the new skill gives AI assistants context on Prezet's conventions. Useful for scaffolding front matter, but treat generated markdown as draft-only.

Gotchas and Tips

  • Stale index is the #1 bug report. The route resolves through the SQLite table, so a newly-added file 404s until you index. Bake indexing into deploy and into any dev workflow that touches content/.
  • SQLite path and permissions: the index DB lives wherever config/prezet.php points (typically database/prezet.sqlite). On container hosts that get recreated, that file vanishes — provision it from a build step or point at a persistent disk.
  • Front matter float coercion (fixed in v1.4.0): older versions silently cast values that look numeric — dates like 2024-01-01, versions, ISBNs — to floats, mangling output. If you were string-quoting front matter values as a workaround, you can drop that on ^1.4.0.
  • Laravel 13 support (v1.4.0): forward-compatible with the Laravel 13 release line. Upgrade your framework dependencies together with this package, since the PR was paired with a dependency bump.
  • Slug changes require a re-index. Renaming a file does not retire the old slug from the table until prezet:index runs; until then you can serve a 200 on a dead URL.
  • Route collision: Prezet::routes() registers a catch-all under your configured prefix. If you also have an application route under /blog/..., yours must be registered first or you must narrow the Prezet prefix.
  • Drafts: the draft: true front matter is respected at query time, not at file discovery — draft files are still indexed. Gate previews behind auth in production, or delete drafts before building the prod index.
  • Custom views override the package defaults via standard vendor:publish namespacing. Keep an eye on the published view diff when bumping the package — the prose/layout markup can change between minor versions.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator
equipc/laravel-email-database-log
adedsec/nova-translated-labels