Skip to content

Commit 0d1d017

Browse files
committed
Merge branch 'master' of github.com:binarycabin/laravel-uuid
2 parents 136170f + b91c159 commit 0d1d017

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

src/Traits/HasUUID.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,20 @@ trait HasUUID
66
{
77
public static function bootHasUUID()
88
{
9-
static::creating(function($model) {
9+
static::creating(function ($model) {
1010
$uuidFieldName = $model->getUUIDFieldName();
11-
if(empty($model->$uuidFieldName)){
11+
if (empty($model->$uuidFieldName)) {
1212
$model->$uuidFieldName = static::generateUUID();
1313
}
1414
});
1515
}
1616

1717
public function getUUIDFieldName()
1818
{
19-
if(!empty($this->uuidFieldName)){
19+
if (! empty($this->uuidFieldName)) {
2020
return $this->uuidFieldName;
2121
}
22+
2223
return 'uuid';
2324
}
2425

@@ -36,5 +37,4 @@ public static function findByUuid($uuid)
3637
{
3738
return static::byUUID($uuid)->first();
3839
}
39-
40-
}
40+
}

tests/HasUUIDTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@
66

77
class HasUUIDTest extends TestCase
88
{
9-
109
public function test_coming_soon()
1110
{
1211
$this->assertTrue(true);
1312
}
14-
15-
}
13+
}

0 commit comments

Comments
 (0)