aerni/snipcart
Laravel integration for the Snipcart e-commerce platform, providing a convenient way to connect your application to Snipcart's shopping cart features using familiar Laravel conventions.
v1.0.0 is the first stable release, and it is effectively a new package compared to the beta line — config, product blueprint, tags and modifiers were all refactored. Budget for a fresh install rather than an in-place upgrade.
Config-as-source-of-truth. Keep the published config under version control and drive collection handles, blueprint paths and modifier registrations from it (env-driven where the value differs between environments). Never reference a collection handle literally in application code — resolve it from config so renames don't cascade.
Blueprint as code. Store the product blueprint in the repo and deploy it alongside the config. Treat it like a migration: changes should be reviewed, and you need a deliberate step (re-save, sync command, or a one-off script) to apply field changes to existing products, because existing entries generally don't pick up blueprint edits automatically.
Modifiers as a composable pipeline. Register modifiers in config and keep each one small and side-effect free. Order matters — apply pricing/availability modifiers before presentation modifiers, and be explicit about ordering in the config rather than relying on registration order. If modifiers touch the database or an external API, batch or cache them; a modifier that queries per-product is the most common performance cliff in this kind of addon.
Tags: register, then cache. Define custom tags through the documented extension point rather than editing vendor code. Tag output is usually the expensive part of a page render, so cache the rendered result (or the underlying product lookup) and key the cache on the product collection plus any filter parameters.
Migration script for beta data. Rather than hand-editing, write a one-off artisan command that maps old product fields → new blueprint fields, re-attaches tags, and writes into the new collection. Run it against a staging copy, diff a sample of products, then run in production. Keep the command in the repo (not deleted) so you can re-run in a rollback scenario.
Testing. Give the test suite its own product collection + blueprint fixture and a factory, so tests don't depend on production content. Assert on modifiers and tag output separately — they fail independently.
Deployment. After config or blueprint changes, re-run the config cache and clear the addon's data/index cache as part of the deploy. Wire this into your deploy script; it is the single most common cause of "works locally, broken in staging".
null means "field missing" versus "not yet migrated".php artisan config:clear and a fresh config:cache after every config edit.^1.0 and read changelogs for minor releases; the beta-era habit of "just update and fix what breaks" is no longer appropriate for production.composer create-project-style install of the package.How can I help you explore Laravel packages today?