File tree 2 files changed +6
-8
lines changed
2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -6,19 +6,20 @@ trait HasUUID
6
6
{
7
7
public static function bootHasUUID ()
8
8
{
9
- static ::creating (function ($ model ) {
9
+ static ::creating (function ($ model ) {
10
10
$ uuidFieldName = $ model ->getUUIDFieldName ();
11
- if (empty ($ model ->$ uuidFieldName )){
11
+ if (empty ($ model ->$ uuidFieldName )) {
12
12
$ model ->$ uuidFieldName = static ::generateUUID ();
13
13
}
14
14
});
15
15
}
16
16
17
17
public function getUUIDFieldName ()
18
18
{
19
- if (! empty ($ this ->uuidFieldName )){
19
+ if (! empty ($ this ->uuidFieldName )) {
20
20
return $ this ->uuidFieldName ;
21
21
}
22
+
22
23
return 'uuid ' ;
23
24
}
24
25
@@ -36,5 +37,4 @@ public static function findByUuid($uuid)
36
37
{
37
38
return static ::byUUID ($ uuid )->first ();
38
39
}
39
-
40
- }
40
+ }
Original file line number Diff line number Diff line change 6
6
7
7
class HasUUIDTest extends TestCase
8
8
{
9
-
10
9
public function test_coming_soon ()
11
10
{
12
11
$ this ->assertTrue (true );
13
12
}
14
-
15
- }
13
+ }
You can’t perform that action at this time.
0 commit comments