tomatophp/tomato-branches-module
Tomato Branches is a module for the TomatoPHP ecosystem that adds branch and location management to your Laravel app, letting you organize records and users by branch, typically through a Filament admin panel.
branch_id and scoping trait in place, then turning on multi-location later without a schema rewrite. Approving it early is a hedge against rework, not just a feature.belongsTo) vs. many (belongsToMany with a pivot), and whether branch maps onto Spatie's team_id. That decision is cheap now and expensive later; the module makes it a visible, dated choice rather than an accidental one.Consider it when:
CurrentBranch resolver, queue/console overrides, and your own add_branch_id_to_* migrations.Look elsewhere when:
PanelProviders where auto-discovery will not fire.Gate before committing: a time-boxed spike that pins Filament and the module together (v4 targets Filament v3; 3.x lines target v2 — mismatches surface as blank pages or Class not found), confirms the module enables cleanly via modules_statuses.json + config clear, and walks one real branch-aware query end to end. Read the v1.0.0→v1.0.1 diff and check test coverage — sparse notes mean validation happens in the spike, not in the version number.
For executives: This is an open-source Laravel module that gives us branch/location management — the entity, the user assignments, the query scoping, and the admin screens — instead of us building it. It shortens time-to-market for multi-location features and lets engineering spend its time on the branch-aware logic customers pay for. Cost to try is low if we are already on the TomatoPHP/Filament stack; cost to adopt is a platform commitment to that ecosystem for our admin surfaces. Two honest caveats: the package has no visible adoption (zero dependent projects, zero stars) and no release since March 2024, so we would be an early adopter carrying maintenance risk. Recommendation: fund a short, time-boxed spike with a defined exit criteria, and treat "adopt" as conditional on it passing — not as a decision made today.
For engineering: Use it as a head start, not a foundation you cannot leave. The value is the Branch model, the migrations, and the Filament resource schema — copy the patterns into your own resources where sensible. Do not edit shipped migrations or vendor PHP; add your own add_branch_id_to_* migrations and extend or subclass the resource so composer update stays clean. Pin filament/filament and the module together and verify the version line before install. Put branch resolution behind a CurrentBranch singleton (session → user default → first active branch) so queued jobs and console commands can override it explicitly — that is the piece most likely to bite you in production. Top failure mode is "installed but invisible": check php artisan about, module:list, the panel's plugin registration, and route:list | grep branch before assuming a code problem. Known risks: ecosystem lock-in, unclear long-term maintenance, and whether the user↔branch cardinality and any Spatie team_id overlap match our permissions model — settle that before the first migration, because retrofitting team scoping is painful.
How can I help you explore Laravel packages today?