ozankurt/laravel-modules-forum
ozankurt/laravel-modules-core and ozankurt/laravel-modules-interactions. Publish the package config and migrations, then run php artisan migrate.ThreadObserver, Thread::scopeSearch(), and the Filament resources. These are the main day-to-day surfaces.Board, create a Thread under it, add a reply, then verify board.post_count reflects the post. Soft-delete and restore the thread and confirm the counter returns to the correct value. This exercises the observer, soft-delete path, and counter contract in one pass.ThreadObserver now uses increment(), decrement(), and incrementEach() to keep board.post_count correct; don’t manually set or recalculate the counter in normal flows.Thread::create(), $thread->delete(), $thread->restore(), and post creation via relationships are the expected paths. The observer handles counter semantics consistently across soft delete and restore.Thread::search($term) (the scopeSearch entry point). The scope is deliberately join-free, which is why the ranking CASE no longer qualifies with getTable(). Keep custom search extensions join-free unless you re-qualify columns.laravel-modules-core conventions for service provider/module registration, and use laravel-modules-interactions for cross-module hooks. Keep package-specific behavior in observers, scopes, and resources rather than scattering it through app code.DB::raw() and orderByRaw() now expect literal strings. Do not splice runtime values into raw SQL. Use query-builder methods, bindings (selectRaw('... ?', [$value])), or the observer’s increment()/decrement()/incrementEach() helpers. If you override or extend ThreadObserver, preserve the atomic counter operations.Thread::scopeSearch() intentionally drops the table qualifier because it never joins. If you add joins in a custom search scope, re-qualify columns to avoid ambiguous SQL.board.post_count. Use the package models, or mirror the ThreadDeletionDriftTest approach to assert board.post_count matches a recount across soft delete and restore.How can I help you explore Laravel packages today?