Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Eloquent Binary Uuid Laravel Package

verbanent/eloquent-binary-uuid

Store UUID primary keys as compact 16-byte binary values instead of 36-character strings. This Laravel/Eloquent package provides casts and model traits for efficient binary UUIDs, reducing storage and improving index performance.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

  • Architecture fit: The package integrates with Laravel’s Eloquent ORM and migration system to store UUIDs as 16-byte binary columns, reducing storage versus string UUIDs. It fits existing Laravel applications that use UUIDs as primary or foreign keys and want compact storage. v1.11.0 does not alter the core architecture; it strengthens validation and error reporting around the uuid() / foreignUuid() helpers and model traits.
  • Integration feasibility: Low effort. Installation remains Composer-based with trait/model configuration ($uuidColumn) and optional config (binary-uuid.default_column). No API changes are introduced. The improved error messages and README Troubleshooting section reduce integration friction. The one behavioral change—rejecting values the creating hook cannot encode—affects only inserts that were already storing malformed data.
  • Technical risk: Low overall. The new InvalidBinaryUuidException is additive, and the TypeError fix is positive. The behavioral change prevents silent truncation (e.g., MySQL non-strict mode) but may surface latent bugs in applications that previously inserted non-UUID values. Risk is concentrated in existing bad data or code paths that write invalid values. Correctly configured models behave exactly as before.
  • Key questions: Which Laravel and PHP versions are supported? Which databases are officially supported (MySQL, PostgreSQL, SQLite)? Are there existing rows with invalid 16-byte UUID columns that need cleanup? Does the package provide validation rules or migration helpers for repairing malformed data? What is the recommended upgrade path from earlier versions? Are there performance or indexing implications when switching from string to binary UUIDs? Does the package enforce UUID version/format beyond length? How should applications handle the new exception in existing insert flows?

Integration Approach

  • Stack fit: Laravel/PHP stack with Eloquent models and migrations. Best suited to applications using binary UUID columns and wanting Laravel-native helpers. Confirm database compatibility against your stack; the release notes imply MySQL-oriented behavior but do not enumerate supported databases.
  • Migration path: Update via Composer to v1.11.0. No API changes, so no code rewrites are required for correctly configured models. Before upgrading, audit production and staging data for non-16-byte UUID values. Update tests to assert the new exception for invalid inserts. Ensure models set $uuidColumn correctly or that binary-uuid.default_column matches the schema.
  • Compatibility: Backward compatible for correctly configured models. The new exception class is additive. The behavioral change may affect edge cases where invalid values were previously passed through. Verify PHP/Laravel version constraints in composer.json; the release notes do not state them.
  • Sequencing: 1) Review release notes and changelog. 2) Run the application test suite against v1.11.0 in a staging environment. 3) Audit existing data for invalid binary UUIDs and plan cleanup if needed. 4) Update Composer dependency. 5) Deploy to staging and monitor for InvalidBinaryUuidException. 6) Deploy to production. 7) Update internal runbooks to reference the README Troubleshooting section.

Operational Impact

  • Maintenance: Improved error messages name the model, column, and suggested fix, reducing debugging time. The README Troubleshooting section makes the message searchable. No new dependencies. The one-time data audit is the main maintenance task.
  • Support: Clearer exceptions (InvalidBinaryUuidException, enhanced AccessedUnsetUuidPropertyException) reduce mean time to resolution and support tickets. Support staff can point developers to the Troubleshooting section for common misconfigurations.
  • Scaling: No negative impact. Binary UUIDs remain storage-efficient. Validation occurs on insert only, so overhead is negligible. Error handling is clearer without adding significant processing.
  • Failure modes: New InvalidBinaryUuidException is thrown on inserts that cannot be encoded, replacing silent pass-through/truncation. This is safer but may surface latent data-quality issues. The TypeError fix prevents non-string values from reaching Uuid::isValid(). Applications catching generic exceptions may need to adjust handlers to account for the new exception type.
  • Ramp-up: Low. No API changes means minimal retraining. Developers receive actionable errors, and the README troubleshooting guidance accelerates onboarding. Communicate the behavioral change to teams that write to UUID columns so they understand why previously “working” invalid inserts may now fail.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle
glavweb/extra-bundle
glavweb/api-bundle
glavweb/admin-bundle