Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Traits/Eloquent/HasUuid.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ trait HasUuid
* This method is called automatically when the trait is being used by a model.
* It registers a "creating" event that generates a UUID and assigns it to the specified column.
*/
public static function bootHasUUID(): void
public static function bootHasUuid(): void
{
static::creating(function ($model) {
static::creating(function ($model): void {
$column = $model->getUuidColumn();
$model->$column = uuid();
$model->$column ??= uuid();
});
}

Expand Down
2 changes: 1 addition & 1 deletion tests/Traits/Eloquent/HasUuidTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
};

// Simulate the "creating" event
$model->bootHasUUID();
$model->bootHasUuid();

expect($model)->toBeInstanceOf(Model::class);
});
Expand Down
Loading