- How do I install dragon-code/size-sorter in a Laravel application?
- Install it with composer require dragon-code/size-sorter. It is MIT licensed and PSR-4 autoloaded, and the assessment notes no configuration publication is required for a basic sort. The Laravel facade is described as optional, so verify the actual service provider or facade surface in a short spike before wiring it into application code.
- Which size systems does size-sorter support, such as clothing, bra size, and furniture?
- The package is described for clothing size, height, bra size, furniture size, and more. The real value is its built-in size tables, so confirm coverage for the exact systems you sell into, including regional or vanity sizing such as EU versus US or UK. The assessment specifically flags that validation as a spike task.
- Is dragon-code/size-sorter Laravel-only or framework-agnostic PHP?
- It is a framework-agnostic PHP domain utility with an optional Laravel facade according to the assessment. That means it can run in a Laravel monolith, a separate catalog or search service, or a queue worker that reindexes products. Laravel integration is a convenience, not a hard requirement.
- What happens when size-sorter receives an unrecognized size string?
- The provided context does not define the behavior for unrecognized sizes, and the assessment calls this out as a key question. You need to determine whether it throws, returns null, or sorts arbitrarily before relying on it. Test that behavior in a spike and decide how your adapter will handle invalid or unmapped values.
- Can I use size-sorter to order Eloquent query results by clothing size?
- The package is a comparator or value utility; it has no persistence, migrations, or database ordering layer. It can supply the ordering semantics, but query-time ordering at catalog scale may require a persisted sort key per size in your own schema. Keep it behind your own interface rather than calling it directly from query builders or controllers.
- What PHP and Laravel versions does dragon-code/size-sorter support?
- The exact minimum PHP version and Laravel support matrix are not stated in the provided context. Check the package composer.json constraints and compare them with your oldest supported application before adoption. If your platform is older than the package allows, that is a blocking integration risk.
- Is dragon-code/size-sorter actively maintained and production-ready?
- Adoption is very low, with 39 stars and zero dependents reported, and it is a single-maintainer package. The recorded last release date is flagged as anomalous, so confirm actual release history and commit activity rather than assuming active maintenance. MIT licensing lets you fork if needed, but the fork becomes your maintenance burden.
- How should I test size ordering with size-sorter?
- Wrap the package behind your own interface, such as a SizeOrderResolver, and test through that boundary. Cover the size systems you actually sell into plus edge cases like unknown strings, regional sizing, and mixed men's, women's, or kids' scales. Because ordering is customer-visible, a mis-ordered size filter is a product defect, not cosmetic.
- What are alternatives to dragon-code/size-sorter?
- The assessment frames adoption as buying a dataset more than a library, so the practical alternative is maintaining your own size taxonomy and comparator. You could also fork the package or extract its size tables and drop the dependency while keeping your adapter. There is no differentiator here; it is table-stakes plumbing.
- Does size-sorter replace catalog size modeling in my database?
- No. It complements catalog modeling by supplying ordering semantics for human-readable sizes. You still need your own size taxonomy, such as an enum or attribute table, in your schema. The package has no persistence or migrations and does not become the system of record for sort order.