Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Forklift Laravel Package

kanata-php/forklift

Forklift is a Laravel package for moving and reshaping data between sources: define a source, map its fields, and run repeatable transfers through a clean, fluent API. A practical fit for imports, legacy migrations, and keeping databases in sync.

View on GitHub
Deep Wiki
Context7

Getting Started

  1. Install the package with Composer using the package name from its README, then publish any provided config/migrations if applicable.
  2. Look first at the repository contracts, especially the interface that now exposes findLocation. In 0.1.0, repositories are specialized to the model combinations they handle, so identify the concrete repository for your model pair before wiring anything.
  3. First use case: bind the specialized repository for your model combination in a service provider or test, inject it into a service/controller, and call findLocation using the new reduced-parameter signature. Confirm the return contract in a small feature test before migrating broader code.

Implementation Patterns

  • Prefer one repository per model combination rather than a generic repository. Name them by intent, e.g. OrderLocationRepository, and bind the matching interface to the concrete implementation.
  • Use constructor injection for repositories. Avoid resolving them with app() so the specialized binding is explicit and testable.
  • Migrate callers by removing parameters that are now encapsulated by the specialized repository. The repository should already know which model combination it serves; callers should not re-pass that context.
  • Treat findLocation as a query method with a defined not-found contract. Wrap it in an application service if you need consistent null handling, exceptions, or DTO mapping.
  • For apps with multiple model combinations, use contextual binding or a small binding map so each service receives the correct specialized repository.
  • In tests, bind a fake implementation of the repository interface and assert that findLocation is called with the new, smaller argument set. Add at least one integration test against the real repository for the model combination you rely on.

Gotchas and Tips

  • This is a breaking interface change. Any custom repository implementations, test doubles, decorators, or container bindings must be updated to match the new signatures and add findLocation.
  • Because repositories are now specialized, a wrong container binding can silently query the wrong model combination. Verify bindings per feature and per test case.
  • Do not keep passing model context into repository methods just because older code did. Check the new interface signature and remove obsolete parameters at the call site.
  • Confirm findLocation semantics before relying on it: whether it returns null, throws, applies global scopes, respects soft deletes, and what coordinate/address format it expects.
  • Debug container errors such as “Target [RepositoryInterface] is not instantiable” by checking the service provider binding and whether the specialized repository is registered for the correct interface.
  • Since this is a 0.1.x release, expect API instability. Pin the version in composer.json, review release notes before upgrading, and keep repository adapters thin so future interface changes are contained.
  • Extension point: implement the repository interface for custom lookup behavior, or decorate the package repository to add caching/logging without changing callers.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
takashato/laravel-vietqr
aitor24/laralang
kraenzle-ritter/entity-relations
dindigital/din-image
pomirleanu/image-colors
sawmainek/laravel-api-generator
delatbabel/jsonresponses
mouhamedfd/permissions-generator
eduplus/qr
laravel2580/idehelpers
delatbabel/viewpages
anavel/gettext
muhamadrezaar/highcharts
delatbabel/keylists
frankkessler/salesforce-laravel-oauth2-rest
anavel/foundation
wdmtech/enviricons
eii/laravel-captcha
muka/shape-reader
tdt/json