File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,13 @@ public function isNullable(): bool
5555 */
5656 public function multiple (bool $ value = true ): static
5757 {
58+ $ name = match ($ value ) {
59+ true => $ this ->getAttribute ('name ' ).'[] ' ,
60+ default => trim ($ this ->getAttribute ('name ' ), '[] ' ),
61+ };
62+
63+ $ this ->setAttribute ('name ' , $ name );
64+
5865 return $ this ->setAttribute ('multiple ' , $ value );
5966 }
6067
Original file line number Diff line number Diff line change 77use Closure ;
88use Cone \Root \Support \ClassList ;
99use Illuminate \Support \Arr ;
10+ use Illuminate \Support \Str ;
1011use Illuminate \View \ComponentAttributeBag ;
1112
1213trait HasAttributes
@@ -21,7 +22,7 @@ trait HasAttributes
2122 */
2223 public function id (string $ value ): static
2324 {
24- return $ this ->setAttribute ('id ' , strtolower ($ value ));
25+ return $ this ->setAttribute ('id ' , Str:: of ($ value)-> slug ()-> value ( ));
2526 }
2627
2728 /**
You can’t perform that action at this time.
0 commit comments