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

Laravel Eloquent Model Uuid Laravel Package

glorand/laravel-eloquent-model-uuid

Adds UUID primary keys to Laravel Eloquent models via a simple trait. Automatically generates unique IDs on model creation, keeps database keys non-sequential, and makes records safe to expose in URLs and distributed systems without leaking counts.

View on GitHub
Deep Wiki
Context7

Getting Started

The 4.0.0 release is a compatibility release: it adds Laravel 9 support. There are no documented new package-level features in the release note, so treat this as a framework/runtime support bump and validate your existing integration on Laravel 9.

Minimal upgrade path:

  1. Confirm your app meets Laravel 9 requirements: PHP >= 8.0.2, Composer 2, and compatible Symfony 6 components.
  2. Update the package constraint in composer.json to ^4.0 and run composer update.
  3. If the package publishes configuration, re-publish or diff it:
    php artisan vendor:publish --provider="Vendor\\Package\\PackageServiceProvider" --tag=config
    
  4. Clear cached discovery and config:
    php artisan package:discover
    php artisan config:clear
    
  5. Run your test suite and a smoke test of the package’s primary entry point (facade, helper, or injected service).

Where to look first:

  • composer.json of the package for Laravel/PHP constraints.
  • The package service provider for bindings, config merging, and auto-discovery.
  • The package config file for environment-driven options.
  • The README/upgrade guide for any 3.x → 4.x changes not captured in the release note.

First use case: upgrade an existing Laravel 8 application to Laravel 9 while keeping the package’s day-to-day API unchanged. Install the package in a fresh Laravel 9 skeleton first to isolate framework compatibility issues from application-specific ones.

Implementation Patterns

Because the release note only documents Laravel 9 support, the day-to-day usage patterns remain the same as previous major versions. The Laravel 9-specific patterns are about dependency resolution and runtime compatibility.

Typical integration patterns:

  • Auto-discovery first. Laravel 9 still supports package auto-discovery. Avoid manually registering the provider unless discovery is disabled or you need to override bindings.
  • Constructor injection over facades. Inject the package’s service/interface into controllers, jobs, and commands. This keeps tests isolated and avoids facade alias issues.
  • Config-driven behavior. Publish the package config and drive environment-specific behavior through config/*.php and .env. Use config() inside your own code rather than reading env() directly, especially with config caching.
  • Service provider overrides. If you need to swap an implementation, bind your own class to the package’s interface in AppServiceProvider::register() after the package provider has run.
  • Queue and command usage. If the package exposes jobs or console commands, verify they still resolve on Laravel 9’s container and signature APIs. Laravel 9 tightened some command and dispatch signatures.
  • CI matrix. If you support both Laravel 8 and 9, test against both. Pin the package major version per framework branch rather than trying to support one constraint across incompatible frameworks.
  • Testing. Use the package’s own testing helpers if available; otherwise bind a fake/mock implementation in the container and assert interactions. Laravel 9’s testing APIs are largely unchanged, but PHPUnit 9.5+ is expected.

A safe rollout pattern:

  1. Add the package to a Laravel 9 branch.
  2. Run composer why-not vendor/package 4.0.0 to identify conflicting constraints.
  3. Exercise the package’s main workflow in a feature test.
  4. Deploy behind a feature flag or canary if the package touches payments, auth, storage, or external APIs.

Gotchas and Tips

  • Major version does not guarantee only a Laravel bump. The release note says “add support for Laravel 9,” but 4.0.0 is a major version. Check the package changelog/upgrade guide for dropped PHP/Laravel versions, renamed classes, changed config keys, or altered defaults.
  • Laravel 9 requires PHP 8.0.2+. Ensure CI, local Docker images, and production runtimes match. Packages that still support PHP 7.4 cannot be used on Laravel 9.
  • Symfony 6 conflicts. Laravel 9 moved to Symfony 6 components. Third-party packages pinned to Symfony 5 can block the upgrade. Use composer why-not and composer update --with-all-dependencies carefully.
  • Config caching surprises. After changing package env variables, run php artisan config:clear. In production, config:cache will freeze values; ensure deploy scripts clear and rebuild caches.
  • Package discovery cache. If the provider is not loading, run php artisan package:discover and check bootstrap/cache/packages.php.
  • Facade aliases. If you use the package facade, prefer the fully qualified class name in new code to avoid alias registration issues. Confirm the alias is still registered in 4.x.
  • Deprecated Laravel APIs. Laravel 9 removed or deprecated several older APIs (e.g. some string/array helpers, older Flysystem behavior). If the package wraps filesystem or mail, test those paths explicitly.
  • Debugging resolution failures. Use composer show vendor/package, composer why-not, and php artisan about to confirm framework and package versions. For container errors, inspect the provider’s register() and boot() methods and clear compiled services with php artisan clear-compiled.
  • Extension points. The most stable extension points are published config, container bindings to package interfaces, and package events. Avoid extending concrete classes unless the package documents them as extension points; major versions often change internals.
  • Limited release-note detail. This assessment is based on the 4.0.0 note. Confirm the actual public API, config keys, and upgrade steps in the package README before relying on specific class names or behaviors.
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.
skyraptor/chatter
edlugz/sasapay
abbasudo/artisan-route
mirvan/ippanel
ignibyte/aic-framework
glavweb/data-schema-bundle
glavweb/datagrid-bundle
tacticmedia/scim-server
uni-method/frame
neika-ai/sdk
adachsoft/php-code-style
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
adachsoft/api-version-bundle
cgv/localized-resource