- Can I use this package for a Laravel zakat platform targeting Indonesia?
- Yes, this package is specifically designed for Indonesian zakat platforms. It includes pre-built Eloquent models for donors, geographic hierarchies (country to village), education levels, jobs, and marital status, which align perfectly with local compliance needs.
- How do I install and set up inisiatif/model-shared in my Laravel project?
- Run `composer require inisiatif/model-shared` to install. No additional configuration is needed for basic models, but dynamic relations like `branch` or `employee` require defining `resolveRelationUsing` in a service provider’s `boot` method, as shown in the README.
- Does this package support Laravel 10+?
- The last release was in 2026, so test compatibility with your Laravel version. If issues arise, check for Laravel version constraints in `composer.json` or fork the package to update dependencies like `ramsey/composer-install` to v4.
- What if I already have donor or region tables in my database?
- The package includes migrations, but conflicts may occur. Run `php artisan migrate --pretend` to preview changes, then manually merge or adjust existing tables. For example, the `donors` table may need column additions like `donor_phone_id` if upgrading.
- How do I customize the Donor model to add fields like corporate donor attributes?
- Extend the `Donor` model by creating a child class or using traits. Override migrations to add custom fields, but ensure schema consistency. For dynamic relations (e.g., `branch`), update the `resolveRelationUsing` logic in your service provider.
- Are the geographic models (country→village) flexible enough for non-Indonesian use?
- No, the models are hardcoded for Indonesia. For global applications, you’d need to fork the package and replace the geographic data or build a separate region system. The hierarchy structure (5-level nesting) may also impact query performance.
- How do I enable dynamic relations like `Donor::branch()` if I don’t use the default Branch model?
- Define the relation in a service provider’s `boot` method using `resolveRelationUsing`. For example, map `branch` to your custom `Branch` model via `belongsTo` with the correct foreign key, as shown in the README’s example.
- What’s the best way to handle UUIDs if my app uses auto-incrementing IDs?
- Standardize on one approach. If your app uses UUIDs, configure the `Donor` model to use them instead of auto-incrementing IDs. For mixed setups, ensure your database and ORM are aligned to avoid conflicts in foreign key relationships.
- Is there a way to adopt this package incrementally (e.g., start with Region models)?
- Yes, the package is modular. You can publish and use individual models (e.g., `Region`, `EducationLevel`) without adopting the entire suite. However, dynamic relations like `Donor::branch()` require the `Donor` model to be fully integrated.
- How do I handle long-term maintenance if the package is no longer actively updated?
- Plan for internal forks or contribute back to the package. Monitor Laravel version compatibility and update dependencies like `laravel/framework` or `illuminate/database` manually. Consider setting up automated tests for critical models.