This repository was archived by the owner on Jan 2, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +31
-1
lines changed Expand file tree Collapse file tree 3 files changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -73,9 +73,19 @@ public function id(): string
73
73
}
74
74
75
75
if ($ this ->name ) {
76
- return $ this ->id = " auto_id_ " . $ this ->name ;
76
+ return $ this ->id = $ this ->generateIdByName () ;
77
77
}
78
78
79
79
return $ this ->id = Str::random (4 );
80
80
}
81
+
82
+ /**
83
+ * Generates an ID by the name attribute.
84
+ *
85
+ * @return string
86
+ */
87
+ protected function generateIdByName (): string
88
+ {
89
+ return "auto_id_ " . $ this ->name ;
90
+ }
81
91
}
Original file line number Diff line number Diff line change @@ -50,4 +50,14 @@ public function __construct(
50
50
$ this ->checked = is_null ($ boundValue ) ? $ default : $ boundValue ;
51
51
}
52
52
}
53
+
54
+ /**
55
+ * Generates an ID by the name and value attributes.
56
+ *
57
+ * @return string
58
+ */
59
+ protected function generateIdByName (): string
60
+ {
61
+ return "auto_id_ " . $ this ->name . "_ " . $ this ->value ;
62
+ }
53
63
}
Original file line number Diff line number Diff line change @@ -35,4 +35,14 @@ public function __construct(
35
35
$ this ->checked = (is_null ($ boundValue ) ? $ default : $ boundValue ) == $ this ->value ;
36
36
}
37
37
}
38
+
39
+ /**
40
+ * Generates an ID by the name and value attributes.
41
+ *
42
+ * @return string
43
+ */
44
+ protected function generateIdByName (): string
45
+ {
46
+ return "auto_id_ " . $ this ->name . "_ " . $ this ->value ;
47
+ }
38
48
}
You can’t perform that action at this time.
0 commit comments