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 Uuid

Laravel Uuid Laravel Package

emadadly/laravel-uuid

A lightweight Laravel package that adds UUID support to Eloquent models. Use the HasUuid trait to automatically generate UUIDs on model creation, as an extra column or primary key, with configurable column names and minimal setup.

View on GitHub
Deep Wiki
Context7

laravel uuid a simple, automatic UUID generator for any model based on Laravel

Frequently asked questions about Laravel Uuid
How do I install emadadly/laravel-uuid in a Laravel app?
Install it with Composer using composer require emadadly/laravel-uuid. On Laravel 11 and 12 the service provider should be auto-discovered, and any configuration can be published if the README requires it. Before committing, run a dry-run install to confirm the package's illuminate and PHP constraints match your application.
Which Laravel versions does emadadly/laravel-uuid support?
The 1.3.6 release note says Update to Laravel 12, which indicates Laravel 12 support. The available evidence does not show whether Laravel 10 and 11 remain supported or whether the illuminate constraints were narrowed. Inspect composer.json at the exact version you plan to use before upgrading.
Does laravel-uuid work with Laravel 12 and PHP 8.2?
Version 1.3.6 includes a Laravel 12 update, and Laravel 12 itself requires PHP 8.2 or newer. You should still verify the package's composer.json constraints and transitive dependencies, because a Laravel 12 release note does not prove every dependency is compatible. A Composer dry run in a scratch branch is the quickest check.
How do I add automatic UUIDs to an Eloquent model?
Add the HasUuid trait to the model that should receive a UUID. The package generates the UUID automatically when the model is created, so you do not need to assign it manually in your controller or factory. Use it on models whose database table has the matching UUID column.
Can emadadly/laravel-uuid use a UUID as the primary key?
Yes, the package supports UUIDs as either an extra column or a primary key. If you use a UUID primary key, make sure the model is configured for non-incrementing string keys and that the migration uses an appropriate UUID or char column. Check the package README for the exact trait properties or config keys.
How do I change the UUID column name in laravel-uuid?
The package supports configurable UUID column names, so you are not locked to a single default column. Publish any provided configuration or set the documented trait property, then update your migration and model casts to match. Confirm the exact option name in the README because the available excerpt does not list it.
Is emadadly/laravel-uuid suitable for production use?
It is a lightweight package with a narrow purpose, which keeps integration risk low. Production suitability still depends on the exact Laravel and PHP constraints, CI coverage, and transitive dependency health, none of which are fully visible in the provided release note. Pin the version, test against your Laravel version, and keep the previous lockfile for rollback.
How should I test UUID generation in a Laravel application?
Create a model instance in a test and assert that the configured UUID column is populated and valid. Use RefreshDatabase or DatabaseTransactions so the test does not leave rows behind. If the UUID is a primary key, also assert that the key is a string and that the model does not increment.
What are alternatives to emadadly/laravel-uuid?
Laravel provides built-in helpers such as Str::uuid and the HasUuids trait, which may cover simple automatic UUID needs without an extra package. Other alternatives include dedicated UUID libraries and model traits from larger Laravel utility packages. Compare column naming, primary-key behavior, Laravel version support, and maintenance activity before switching.
Will upgrading to laravel-uuid 1.3.6 break Laravel 10 or 11 applications?
That is the main risk to verify. A patch version that adds Laravel 12 support may have narrowed illuminate constraints, which would be a breaking change for older Laravel versions despite the 1.3.6 number. Read composer.json, run composer require --dry-run, and use composer why-not to identify blockers before updating.
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.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console