File tree Expand file tree Collapse file tree 2 files changed +32
-1
lines changed
Expand file tree Collapse file tree 2 files changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,22 @@ class Checkbox extends Select
99 */
1010 protected string $ template = 'root::fields.checkbox ' ;
1111
12+ /**
13+ * {@inheritdoc}
14+ */
15+ public function multiple (bool $ value = true ): static
16+ {
17+ return $ this ;
18+ }
19+
20+ /**
21+ * {@inheritdoc}
22+ */
23+ public function size (int $ value ): static
24+ {
25+ return $ this ;
26+ }
27+
1228 /**
1329 * {@inheritdoc}
1430 */
Original file line number Diff line number Diff line change @@ -37,6 +37,11 @@ class Slug extends Text
3737 */
3838 protected bool $ nullable = false ;
3939
40+ /**
41+ * Indicates if the slug should be generated always.
42+ */
43+ protected bool $ always = false ;
44+
4045 /**
4146 * The slug resolver.
4247 */
@@ -71,12 +76,22 @@ public function isNullable(): bool
7176 return $ this ->nullable ;
7277 }
7378
79+ /**
80+ * Set the "always" property.
81+ */
82+ public function alsways (bool $ value = true ): static
83+ {
84+ $ this ->always = $ value ;
85+
86+ return $ this ;
87+ }
88+
7489 /**
7590 * {@inheritdoc}
7691 */
7792 public function persist (Request $ request , Model $ model , mixed $ value ): void
7893 {
79- if (! $ model ->exists ) {
94+ if (! $ model ->exists || $ this -> always ) {
8095 $ model ->saved (function (Model $ model ) use ($ request ): void {
8196 $ value = $ this ->generate ($ request , $ model );
8297
You can’t perform that action at this time.
0 commit comments