webburza/sylius-article-bundle
Sylius Article Bundle adds article and news management to Sylius stores, with admin CRUD, publishing controls, slugs, and storefront integration. Extend your shop with editorial content, announcements, and blog-style posts without custom development.
This release is a patch-level feature bump on a pre-1.0 package (v0.7.0), so treat the API as unstable and pin the exact version in composer.json before upgrading.
composer update to pull v0.7.0, then check whether the package ships new migrations:
php artisan vendor:publish --tag=yourpackage-migrations
php artisan migrate
Category model. The two changes in this release both live there: the new code attribute and the route-binding logic behind the category 404 fix.php artisan route:clear && php artisan config:clear && php artisan cache:clear
code, attach an article, and request the category URL. If it resolves instead of 404ing, the upgrade is behaving. Then verify existing categories (which will have a null code) still resolve.Use code as the stable identifier, slug as the SEO surface. The most natural pattern is to let code be the machine-facing key (API payloads, internal links, imports) and keep slug for public URLs. If the package's route binding now prefers code, decide deliberately which one wins and override resolveRouteBinding() on your extended model if you need slug-based URLs preserved.
Backfill before you enforce uniqueness. The migration almost certainly adds a nullable code column. Existing rows will be null. Backfill in a separate migration or command, then add the unique index — otherwise you get a failed migration on any non-empty production table.
Category::whereNull('code')->each(function ($category) {
$category->update(['code' => Str::slug($category->name)]);
});
Seed codes explicitly. Update your category seeders and factories so tests and local environments exercise the new field rather than relying on it being nullable.
Wrap category lookups in your own resolver. If you expose categories via an API or a menu builder, centralise lookup behind a repository or scope (Category::byCode($code)) rather than scattering where('code', ...) calls. This insulates you from the next binding change in a 0.x release.
Cache invalidation on save. Category trees are a common caching target and a new identifying field is an easy way to serve stale keys. Key your cache on code where you previously keyed on id or slug, and bust on saved/deleted model events.
"vendor/package": "0.7.*" and read the changelog before every bump.route:cache will not pick up the fix until caches are rebuilt. Add cache clears to your deploy script if they are not already there.Category model, add code to $fillable (or $guarded) yourself — published models are not updated by composer update, so your copy will silently drop the field.unique:categories,code rule plus a max length matching the migration; the package is unlikely to ship form request validation for you.php artisan route:list --path=categories to confirm the route and its binding, and Route::getBindingCallback() behaviour via a quick dd() in a tinker session on resolveRouteBinding. Check whether a null code on legacy rows is the actual cause before assuming the package is at fault.How can I help you explore Laravel packages today?