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

Econt Bundle Laravel Package

izopi4a/econt-bundle

A Laravel/PHP bundle for integrating the Econt courier service into your application. It offers convenient access to Econt shipping, delivery, tracking, and order-processing APIs, helping you manage courier workflows and automate logistics tasks from your codebase.

View on GitHub
Deep Wiki
Context7

Getting Started

  1. Require the package via Composer and run composer update to pull v1.0.1.
  2. Publish any config/service provider if the package ships them (php artisan vendor:publish --provider="Vendor\\Package\\ServiceProvider").
  3. Inspect the package’s models/entities first — likely Office, City, and a contact-phone value object. These are the primary objects you will query and serialize.
  4. First use case: resolve an office inside a city by its id and return it as JSON. Example flow:
    • Inject the package’s repository or use its facade.
    • Call the new city-scoped office finder (e.g. $city->findOffice($officeId) or the package’s equivalent).
    • Return response()->json($office) — v1.0.1 adds jsonSerialize() so the object encodes cleanly without manual array mapping.

Implementation Patterns

  • City-scoped office lookup — use the new “find office in a city by id” capability instead of manually filtering a collection. Wrap it in a repository method so you can swap implementations later.
  • JSON responses — because objects now implement JsonSerializable, you can pass them directly to response()->json(), ->toJson(), or Laravel API resources. Avoid hand-building arrays unless you need to reshape fields.
  • Controller / API usage — keep the package calls thin: validate the city and office IDs, delegate to the finder, and let the object serialize itself. Use route-model binding where possible if the package exposes Eloquent-compatible models.
  • Contact phones — after the v1.0.1 fix, normalize phone input before assigning it to an office/contact. Store in a consistent format (e.g. E.164) and rely on the package’s serialization for output.
  • Testing — assert that json_encode($office) contains expected keys and that the city-scoped finder returns null or throws consistently when the office does not belong to the city.
  • Integration tip — if you use the package inside queued jobs or console commands, resolve it through the container rather than instantiating models directly, so config and connections are respected.

Gotchas and Tips

  • jsonSerialize() exposure — automatic serialization may include fields you do not want in public APIs. Audit the output and use $hidden, custom resources, or a wrapper DTO if the package does not support field visibility.
  • City/office ID ambiguity — the new finder is scoped by city; passing a globally valid office ID that belongs to another city should fail safely. Add explicit tests for cross-city lookups.
  • Phone data migration — the contact-phone fix may change how malformed numbers are handled. Re-run import/normalization jobs and validate existing records; do not assume previously stored numbers are clean.
  • Debugging serialization — if json_encode() returns {} or omits fields, check that the object is the package’s class (not a raw array) and that no JsonSerializable implementation is being bypassed by a cast or accessor.
  • Extension points — prefer extending the package’s repository/model classes or binding your own implementation in a service provider over editing vendor files. This keeps upgrades to future 1.x releases safe.
  • Version pinning — v1.0.1 is a patch release, but the new serialization behavior can change API payloads. Pin to ^1.0.1 and review JSON output in staging before deploying.
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.
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator
equipc/laravel-email-database-log
adedsec/nova-translated-labels
wazza/laravel-db-encryption
hokny/laravel-generator
vonsogt/backup
jengo/queues
jeremykenedy/laravel-observability
coleus/frame
thtg88/journalism
filagora/filagora-ai-forums