Skip to content

Commit 1aa1226

Browse files
authored
Merge pull request #76 from bertramakers/str-enum-docs
Add documentation for Str::enum() method
2 parents 55a6482 + 1f4b19e commit 1aa1226

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

docs/attributes.md

+9
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,15 @@ Str::make('name')
132132
->maxLength(20);
133133
```
134134

135+
#### `enum`
136+
137+
You can restrict the string to a set of possible values using the `enum` method.
138+
139+
```php
140+
Str::make('status')
141+
->enum(['to do', 'doing', 'done']);
142+
```
143+
135144
#### `pattern`
136145

137146
You can also validate the string against a regular expression using the

0 commit comments

Comments
 (0)