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
7373 }
7474
7575 if ($ this ->name ) {
76- return $ this ->id = " auto_id_ " . $ this ->name ;
76+ return $ this ->id = $ this ->generateIdByName () ;
7777 }
7878
7979 return $ this ->id = Str::random (4 );
8080 }
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+ }
8191}
Original file line number Diff line number Diff line change @@ -50,4 +50,14 @@ public function __construct(
5050 $ this ->checked = is_null ($ boundValue ) ? $ default : $ boundValue ;
5151 }
5252 }
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+ }
5363}
Original file line number Diff line number Diff line change @@ -35,4 +35,14 @@ public function __construct(
3535 $ this ->checked = (is_null ($ boundValue ) ? $ default : $ boundValue ) == $ this ->value ;
3636 }
3737 }
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+ }
3848}
You can’t perform that action at this time.
0 commit comments