Download the PHP package madad/laravel-sdk without Composer
On this page you can find all versions of the php package madad/laravel-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-sdk
Madad Laravel SDK
Sync your product catalog with Madad in 4 steps. The SDK pushes products on every create/update/delete and ships a one-shot command for the initial load.
Targets Madad Partner API v1.
Requirements
- PHP 8.1+
- Laravel 10, 11, or 12
1. Install
2. Configure (config/madad.php or .env)
The only thing you set is your partner key — the API endpoint is built into the SDK:
Then map Madad's fields to your columns (dot-paths into your model/relations):
Need a computed value? Add a madad{Field}() method to your model — the SDK
prefers it over the map:
The same escape hatch exists for category, specifications and images
(madadCategory(), madadSpecifications(), madadImages()). Each returns the
payload shape directly and overrides its config map entry.
Example — one shared placeholder image (a store with no per-product images):
Or use real images when present and fall back to the placeholder otherwise:
3. Add the trait
From now on every create/update/delete syncs to Madad automatically (queued).
4. Initial load
Pushes your whole catalog (idempotent — safe to re-run; lock-guarded;
self-paced to the rate limit). With queueing enabled, run a worker:
php artisan queue:work.
Sync only part of your catalog (optional)
By default every product syncs. If your store sells things Madad doesn't
list (e.g. a general store with paint and cleaning supplies), add a
shouldSyncToMadad() method to your model — return true only for what belongs
on Madad. You own the rule; you know your category tree:
The same gate is honored everywhere: create, update, delete, and
madad:sync-all. If you don't define it, everything syncs.
Note: if a product leaves scope (e.g. you move it from Paint to Cleaning so
shouldSyncToMadad()now returnsfalse), it is no longer pushed but is not auto-removed from Madad. Delete the record (or call$product->madadDelete()while it's still in scope) to remove it.Large catalogs: to avoid loading out-of-scope rows during
madad:sync-all, you may also add a query scopescopeMadadSyncable($query)— the command uses it as a pre-filter (the per-row check still applies).
Verify the connection
Notes
- Queued by default (recommended). Set
MADAD_QUEUE=falsefor inline sync. - Madad controls
type,brand, anddelivery_typefrom your partner account — they are not sent from your data. - Rate limit: 300 requests/minute per partner; the client backs off on
429. - SDK
v1targets APIv1.
All versions of laravel-sdk with dependencies
illuminate/contracts Version ^10.0|^11.0|^12.0
illuminate/support Version ^10.0|^11.0|^12.0
illuminate/database Version ^10.0|^11.0|^12.0
illuminate/console Version ^10.0|^11.0|^12.0
illuminate/bus Version ^10.0|^11.0|^12.0
illuminate/queue Version ^10.0|^11.0|^12.0
illuminate/http Version ^10.0|^11.0|^12.0
guzzlehttp/guzzle Version ^7.5