visiosoft/cats-module
Visiosoft Cats Module is a Laravel/PyroCMS addon that adds category management to Streams-based applications, letting you create, organize, and relate content through reusable categories and hierarchical structures.
This is a PyroCMS / Streams Platform module, not a standalone Laravel package. Treat it as a taxonomy/categories add-on that plugs into the Streams ecosystem rather than something you require into an arbitrary Laravel app.
Prerequisites
pyrocms/pyrocms or the underlying streams-platform (this module uses Streams' service-provider, migration, and UI registration hooks).2023-11-13 release line will align with the current 3.x PyroCMS generation — check composer.json constraints before installing into an older 1.x/2.x install.Install
composer require visiosoft/cats-module
php artisan migrate
Then locate the module in the PyroCMS admin under the Streams/modules area and enable/seed it as required.
Where to look first (in the source, in this order)
src/CatsModuleServiceProvider.php (or *ServiceProvider) — reveals registered Streams, routes, view namespaces, and admin navigation.src/Cats/ (entity/stream definitions) — the Streams schema (fields, assignments) that defines what a "cat" actually is.migrations/ — table creation, seed data, and field assignments; this is the fastest way to understand the data model.resources/ — admin views and any Blade partials you can reuse or override.config/ — plugin/module config keys, cache settings, and namespace options.First use case
The canonical scenario is attaching a category tree to an existing Streams entry type (posts, products, pages): register the cats stream as a relation, then render/filter entries by category. Build one category tree, attach it to one entry stream, and verify the admin UI + a front-end query before extending further.
Streams-first integration
Repository ($stream->getRepository('cats') or the injected repo) for CRUD so field-type casting, translations, and events fire correctly.where on field slugs) rather than raw SQL against the generated table — schema is Streams-managed and field names are slugs, not columns you can assume.Hierarchical categories
getTree(), getBreadcrumb($slug), getDescendants($id). The module gives you the storage; traversal logic is usually your responsibility.whereIn. Caching the flattened descendant map per tree is the standard optimization.Attaching to entries
cats field type / many-to-many). Pivot tables are managed by Streams, so read the generated schema before hand-writing migrations or join queries.Admin + front-end
php artisan vendor:publish where supported, or via view namespace overrides in your own theme — check the service provider for registered namespaces like visiosoft.module.cats::.Workflow that works
Adoption risk (score ~0.06, 0 stars, 0 dependents)
dd()/log, not by search."visiosoft/cats-module": "0.1.x"-style constraint) and commit the lock file. Treat upgrades as breaking until diffed.Configuration & compatibility
laravel/laravel app will fail or no-op. Confirm streams-platform is present.php artisan cache:clear && php artisan view:clear.Querying pitfalls
$repository->where('category', $x) targets the field slug; raw ->where('category_id', ...) may hit a generated column that differs. Always inspect the generated schema.Debugging
->toArray() may not show every field (field types like relations/grids lazy-load). Dump via field accessors.Extension points
How can I help you explore Laravel packages today?