mouf/utils.common.sortable-interface
A small PHP package from Mouf that defines a common SortableInterface, helping standardize sortable behavior across libraries and components so objects can be sorted consistently in your codebase.
sortBy/orderBy signature.Sortable interface, or leave sorting semantics implicit in each service?Mouf\Utils\Common\SortableInterface. Outside that stack the interoperability value is zero (0 dependents, 1 star, last release 2017-05-17).Adopt it only when all of the following hold:
Mouf\Utils\Common\SortableInterface, and swapping the type would break third-party components.php requirements and no PHP 8.x/enum-era type safety) and that your autoloading handles it.Look elsewhere — or write three lines yourself — when:
orderBy, Eloquent scopes, and mature packages like spatie/laravel-query-builder handle request-driven sorting, key whitelisting, and direction validation. An interface that says "I can sort" adds no enforcement and no behavior.SortDirection enum plus a Sortable interface gives you static-analysis guarantees this package cannot.sortMany, tie-breakers, whitelist validation); if it lives in an abandoned vendor namespace, you inherit its constraints forever.To executives: This is a single-interface utility with no functionality, no adoption (one star, zero dependents), and no maintenance since 2017. It carries effectively zero license cost (MIT) and equally zero business value. Recommendation: do not add it as a dependency. If we want a standard "sortable" contract, engineering can define one internally in under an hour, with better type safety. The strategic takeaway is a governance one — our dependency review caught an abandoned micro-package before it entered the tree.
To engineering: Treat this as a naming precedent, not a library. Define App\Contracts\Sortable with sort(string $key, SortDirection $direction): static, back it with an enum, enforce it via PHPStan, and let Eloquent/spatie/laravel-query-builder own the actual ordering and key-whitelisting. Only take the vendor package if you're inside Mouf and an existing component already type-hints it — in which case pin it, expect no upstream fixes, and plan to fork.
How can I help you explore Laravel packages today?