Skip to content

Commit 4894c52

Browse files
committed
Adjust repeaters doc
This needs to be revisited, but making this change to avoid confusion between form builder / blade repeaters and inline repeaters options. Since inline repeaters are form builder only, it makes more sense to document the methods there, as the table under the repeater section is documenting legacy props of the blade approach. Also changed default value to false in all new documented methods as true makes it sound like those 3 methods are actually called by default.
1 parent 2a2658c commit 4894c52

File tree

2 files changed

+20
-11
lines changed

2 files changed

+20
-11
lines changed

docs/content/1_docs/4_form-fields/11_repeater.md

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,13 @@ Repeater::make()
2929
:::#tab:::
3030
:::#tabs:::
3131

32-
| Option | Description | Type | Default value |
33-
|:---------------|:---------------------------------------------|:--------|:-----------------|
34-
| type | Type of repeater items | string | |
35-
| name | Name of the field | string | same as `type` |
36-
| max | Maximum amount that can be created | number | null (unlimited) |
37-
| buttonAsLink | Displays the `Add` button as a centered link | boolean | false |
38-
| disableCreate | Disables ability to add new items | boolean | true |
39-
| disableActions | Removes row item actions | boolean | true |
40-
| disableReorder | Disables reordering of repeater items | boolean | true |
32+
| Option | Description | Type | Default value |
33+
|:-------------|:---------------------------------------------|:--------|:-----------------|
34+
| type | Type of repeater items | string | |
35+
| name | Name of the field | string | same as `type` |
36+
| max | Maximum amount that can be created | number | null (unlimited) |
37+
| buttonAsLink | Displays the `Add` button as a centered link | boolean | false |
38+
| reorder | Allow reordering of repeater items | boolean | true |
4139

4240
<br/>
4341

@@ -165,6 +163,17 @@ class ProjectController extends BaseModuleController
165163
}
166164
```
167165

166+
| Option | Description | Type | Default value |
167+
|:---------------|:---------------------------------------------|:--------|:-----------------|
168+
| type | Type of repeater items | string | |
169+
| name | Name of the field | string | same as `type` |
170+
| max | Maximum amount that can be created | number | null (unlimited) |
171+
| buttonAsLink | Displays the `Add` button as a centered link | boolean | false |
172+
| disableCreate | Disables ability to add new items | boolean | false |
173+
| disableActions | Removes row item actions | boolean | false |
174+
| disableReorder | Disables reordering of repeater items | boolean | false |
175+
176+
168177
## Blade repeater fields
169178

170179
The following example demonstrates how to define a relationship between `Team` and `TeamMember` modules to implement

src/Services/Forms/Fields/Traits/DisableActions.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ trait DisableActions
99
/**
1010
* Adds a border around the options.
1111
*/
12-
public function disableActions(bool $displayActions = true): static
12+
public function disableActions(bool $disableActions = true): static
1313
{
14-
$this->displayActions = !$displayActions;
14+
$this->displayActions = !$disableActions;
1515

1616
return $this;
1717
}

0 commit comments

Comments
 (0)