Weave Code
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

Shipping Sdk Laravel Laravel Package

dinas/shipping-sdk-laravel

Laravel SDK for the Dinas Shipping API. Send requests to REST endpoints and receive/verify incoming webhooks. Webhook events are logged and dispatched as Laravel jobs for async updates like shipment status changes and document availability.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture Fit

  • Microservice/Modular Fit: The package is a Laravel-specific SDK for the Dinas Shipping API, making it an ideal fit for e-commerce, logistics, or automotive platforms where real-time shipment tracking, document management, and inventory sync are critical.
  • Event-Driven Architecture: Leverages webhooks for asynchronous updates (e.g., shipment status changes), aligning well with event-sourced or CQRS architectures.
  • Facade Pattern: Provides a clean, Laravel-centric facade (Shipping::getCars(), Shipping::syncCars()), reducing boilerplate for API interactions.
  • Domain-Specific Abstractions: Models like Car, Voyage, Document, and AlbumType encapsulate business logic, reducing API endpoint management overhead.

Integration Feasibility

  • Laravel Ecosystem Compatibility: Built for Laravel (v9+), with dependency injection, queued jobs, and event broadcasting support.
  • Webhook Integration: Uses Spatie’s WebhookClient (a battle-tested package), simplifying webhook handling, verification, and retries.
  • Async Job Callbacks: Supports post-processing via onResolve callbacks, enabling workflows like:
    • Notifying users when document uploads complete.
    • Updating inventory systems on shipment status changes.
  • Direct API Access: Allows low-level control via Shipping::cars(), Shipping::carPhotos(), etc., for custom use cases.

Technical Risk

Risk Area Assessment Mitigation
Package Maturity Low stars (0), recent release (2026), but MIT license and active CI/CD suggest stability. Evaluate via test coverage and documentation completeness.
Webhook Reliability Depends on Spatie’s WebhookClient, which is robust but requires proper queue setup (e.g., ShouldQueue jobs). Test webhook idempotency and failure recovery (e.g., retries, dead-letter queues).
Async Job Management Callback storage in webhook_jobs table may bloat over time. Configure delete_after_days and schedule model:prune (as documented). Monitor table growth.
API Versioning No explicit versioning in SDK; assumes Dinas API stability. Monitor Dinas API deprecations and update SDK accordingly.
Performance Async operations (e.g., photo/document uploads) may throttle if not chunked properly. Use Shipping::storeCarPhotos() with default chunking (50 items); adjust via config if needed.
Broadcasting Dependency Pusher broadcasting is opt-in but adds real-time complexity. Disable if not needed (DINAS_SHIPPING_BROADCASTING=false).

Key Questions

  1. Business Use Case:
    • How critical is real-time shipment tracking vs. batch processing?
    • Are webhooks required for core workflows, or can polling suffice?
  2. Scalability:
    • What’s the expected volume of webhook events? (e.g., 100/day vs. 10K/day)
    • How will async job callbacks scale with concurrent uploads?
  3. Error Handling:
    • What’s the SLA for retrying failed webhooks?
    • How will failed document/photo uploads be logged/alerted?
  4. Maintenance:
    • Who will monitor the webhook_jobs table for pruning?
    • How will Dinas API changes be synchronized with the SDK?
  5. Security:
    • Is the webhook secret (DINAS_SHIPPING_SECRET) rotated periodically?
    • Are API tokens stored securely (e.g., Laravel’s env)?

Integration Approach

Stack Fit

Component Fit Level Notes
Laravel Backend ✅ Excellent Native integration with facades, queues, and events.
PHP 8.1+ ✅ Excellent SDK uses modern PHP features (e.g., named arguments, enums).
MySQL/PostgreSQL ✅ Excellent Uses Eloquent models for webhook jobs and migrations.
Redis ✅ Good Required for queue workers (e.g., laravel-queue:work) and broadcasting (if enabled).
Pusher/Alternative ⚠️ Optional Only needed for real-time broadcasts; can be disabled.
Docker/Kubernetes ✅ Good Containerized deployments should handle queue workers and webhook endpoints separately.
Monolithic vs. Microservices ✅ Flexible Works in both; facade pattern simplifies API calls.

Migration Path

  1. Phase 1: API Integration (Low Risk)

    • Install SDK: composer require dinas/shipping-sdk-laravel.
    • Configure .env (DINAS_SHIPPING_TOKEN, DINAS_SHIPPING_SECRET).
    • Publish migrations/config: php artisan vendor:publish --tag=shipping-sdk-laravel-migrations --tag=shipping-sdk-laravel-config.
    • Run migrations: php artisan migrate.
    • Test sync operations (e.g., Shipping::getCars(), Shipping::syncCars()).
  2. Phase 2: Webhook Setup (Medium Risk)

    • Add webhook route: Route::dinasShippingWebhooks('dinas-shipping/webhook').
    • Exclude from CSRF (as per docs).
    • Register webhook: php artisan webhook:dinas-shipping -i.
    • Test webhook delivery using Dinas’s sandbox environment.
  3. Phase 3: Async Workflows (High Value)

    • Implement onResolve callbacks for critical operations (e.g., document uploads).
    • Set up queue workers (laravel-queue:work) to process webhooks asynchronously.
    • Configure broadcasting (if real-time updates are needed).
  4. Phase 4: Monitoring & Optimization

    • Schedule model:prune for WebhookJob cleanup.
    • Monitor queue backlogs and webhook failures.
    • Optimize chunk sizes for bulk operations (e.g., photos).

Compatibility

  • Laravel Version: Tested on Laravel 9+; may require adjustments for older versions.
  • PHP Version: Requires PHP 8.1+ (due to named arguments, enums).
  • Dependencies:
    • Spatie/webhook-client (for webhooks).
    • GuzzleHTTP (for API calls).
    • Laravel Queues (for async jobs).
  • Database: Supports MySQL/PostgreSQL/SQLite (via Eloquent).

Sequencing

Step Dependency Order Notes
Install SDK None 1 composer require dinas/shipping-sdk-laravel.
Configure .env SDK installed 2 Set DINAS_SHIPPING_TOKEN and DINAS_SHIPPING_SECRET.
Publish migrations/config SDK installed 3 php artisan vendor:publish --tag=shipping-sdk-laravel-*.
Run migrations Config published 4 php artisan migrate.
Set up webhook route Migrations complete 5 Add to routes/api.php or routes/web.php.
Exclude webhook from CSRF Webhook route added 6 Update app/Providers/AppServiceProvider.php.
Register webhook with Dinas Webhook route configured 7 php artisan webhook:dinas-shipping -i.
Test API endpoints Webhook registered 8 Verify Shipping::getCars(), Shipping::syncCars(), etc.
Implement queue workers API tests passed 9 laravel-queue:work for processing webhooks.
Set up async callbacks Queue workers running 10
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.
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope