inisiatif/common
Shared Laravel utilities for Inisiatif Zakat Indonesia: a Branch model, UUID and integer primary key traits, branch relations, Eloquent repository and tagged-cache abstractions, contracts, and common exceptions for consistent apps.
Architecture fit
HasBranch, UuidPrimaryKey, IntegerPrimaryKey, TaggableCacheAware, and AbstractRepository can be introduced in new code without forcing a full rewrite.Integration feasibility
composer require inisiatif/common, Laravel package discovery, optional config publishing, one environment variable (COMMON_BRANCH_TABLE_NAME), and optional migration suppression via Common::ignoreMigrations().Inisiatif\Package\Contract\... to Inisiatif\Package\Common\Contracts\... is a clear migration item. Any team adopting mid-project should pin the major version and budget for import refactoring.Technical risk
branches migration may conflict with an existing organization/branch schema. The package allows disabling migrations, but data ownership still needs a decision.TaggableCacheAware depends on cache drivers that support tagging, typically Redis or Memcached. File/database cache drivers will not provide equivalent behavior.AbstractRepository can improve consistency, but it can also hide Eloquent behavior, complicate query optimization, and add unnecessary indirection if the team is not already comfortable with repository patterns.Key questions
TaggableCacheAware, and how will cache invalidation be tested?branches table the system of record, or must it map to an existing organization/master-data service?Stack fit
Migration path
branches migration, and run a small model/repository example against the target database.HasBranch, UuidPrimaryKey or IntegerPrimaryKey, and AbstractRepository in new models/repositories only. Do not rewrite existing repositories until the pilot proves value.branches table or disable migrations and map HasBranch to the existing branch schema. Document foreign keys, indexes, and reporting implications.TaggableCacheAware only after confirming the production cache driver supports tags and after defining invalidation rules for branch and donor data.Compatibility
inisiatif/contract dependency, plan the v3 import rewrite as a separate pull request with static analysis and test coverage.Sequencing
Maintenance
Support
Scaling
branch_id columns are indexed and cache invalidation is designed carefully.branches table, reporting and data reconciliation become operational risks.Failure modes
branches migration clashes with existing schema. Mitigation: decide early whether to use Common::ignoreMigrations() and map to existing data.Ramp-up
How can I help you explore Laravel packages today?