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

Laravel Modules Blog Laravel Package

ozankurt/laravel-modules-blog

A drop-in blog module for Laravel modular applications, providing posts, categories, and admin scaffolding that plugs into your existing module structure with minimal setup.

View on GitHub
Deep Wiki
Context7

Getting Started

This is a Laravel "modules" blog package: posts with slugs (via cviebrock/eloquent-sluggable), view counts, and a cached post-by-slug lookup, plus optional Filament admin resources. v2.0.0 is a baseline release — no source changes, only dependency floors — so the day-to-day experience is identical to the previous line except for the platform requirements.

  1. Confirm your platform. PHP ^8.4 and Laravel ^13.0 are hard requirements in v2.0.0. If you are on Laravel 12 or PHP 8.3, stay on the previous major; there is nothing else in 2.0.0 for you.
  2. Install and let Composer resolve the module stack. The package pulls in ozankurt/laravel-modules-core ^2.0 and ozankurt/laravel-modules-interactions ^2.0 automatically. It also brings spatie/laravel-package-tools and Eloquent Sluggable ^12 || ^13. Filament is optional — 3, 4, and 5 are all supported on this release.
  3. Look first at the published config and migrations. The config controls cache TTL and slug behavior; the migrations give you the posts table (slug column, view-count column). Publish and read both before writing any queries. 4b. Check the Filament resource registration. If Filament is installed, the admin resource should register itself. Confirm it appears before customizing anything.
  4. First use case: create a post (via Filament or the model), visit /blog/{slug}, then hit it again and verify the second request is served from the post-by-slug cache. Then increment views and confirm the slug cache is not invalidated — that is intentional and unchanged in v2.0.0.

Implementation Patterns

  • Resolve posts through the package's cached lookup, not raw Eloquent. Post::where('slug', $slug)->first() bypasses the cache entirely. Use the package's resolver (or route model binding wired to slug) so the cached path is exercised in production the same way it is in tests.
  • Route model binding by slug is the natural fit: the slug is the cache key, so binding by slug keeps cache hits and URL structure aligned.
  • View counting is deliberately decoupled from the slug cache. The documented rule — a view-count-only bump does not invalidate the post-by-slug cache — means counters and cached post payloads are two separate read paths. If you display view counts on a post page, read them fresh rather than expecting the cached post to carry a current number.
  • Invalidate on content changes, not on views. Update and delete flows should bust the slug cache; view increments should not. Understand which model events the package hooks so your own observers don't accidentally re-introduce invalidation on view bumps.
  • Slug changes need explicit handling. If the title changes and Sluggable regenerates the slug, the old URL is gone from the cache and from the DB. Add a redirect or a slug-history table if permalinks matter to you.
  • Cross-module integration via laravel-modules-interactions. Because the package is a module and depends on the interactions package, other modules (comments, analytics, search) should hook the blog through interaction contracts rather than reaching into the Post model directly.
  • Filament customization: the resource is your primary extension point for admin UI. Test any custom resource/page code against the specific Filament major you run — 3, 4, and 5 are all in the CI matrix, which means they are all genuinely exercised, but their extension APIs differ.
  • Testing your integration: mirror the package's own toolchain — Pest 5 on Orchestra Testbench 11. The package ships green at 98 tests / 297 assertions and PHPStan level 8, so if you extend it, matching that bar is a reasonable target.

Gotchas and Tips

  • The upgrade is a platform bump, not a code change. v2.0.0 contains no source changes; the entire risk surface is dependency resolution. If Composer resolves cleanly on PHP 8.4 / Laravel 13, you are effectively running the same code as before.
  • Dropped support is the breaking change. Laravel 12 and PHP 8.3 are gone. Pin the previous major if you cannot move yet; do not try to loosen the constraints with --ignore-platform-reqs.
  • Do not "fix" the view-count cache behavior. A view-count-only bump not invalidating the post-by-slug cache is a deliberate, documented, unchanged semantic. Treat it as a contract. The corollary is that anything derived from views must be read through a non-cached path.
  • Debugging the cache: inspect your cache store directly for the post-by-slug keys. The slug cache and the view-count path are separate concerns — a stale count and a stale post are different bugs with different causes.
  • Eloquent Sluggable v12 vs v13: both are allowed, but slug regeneration on update is configurable and the two majors can differ in defaults. If permalink stability matters, set regeneration behavior explicitly in config rather than relying on defaults.
  • Filament 3/4/5 divergence: the package supports all three, but their resource and form APIs are not identical. Pin your Filament major in composer.json and test upgrades of Filament separately from upgrades of this package — they are independent moving parts in the CI matrix.
  • Extension points, in rough order of safety: config, model subclassing, module service provider, interaction contracts, published views, then overriding the Filament resource. The further down that list you go, the more you are coupled to internals that the release notes do not promise to keep stable.
  • No source changes means no new features. If you are looking for new blog capabilities, this release does not bring them; it is purely a forward-port of the baseline.
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.
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle