From 1f4b19e656ae0f3fd8cfe291c8ca6e27402df8e8 Mon Sep 17 00:00:00 2001 From: Bert Ramakers Date: Wed, 23 Aug 2023 14:14:42 +0200 Subject: [PATCH] Add documentation for Str::enum() method --- docs/attributes.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/attributes.md b/docs/attributes.md index dc074bd..5f3673b 100644 --- a/docs/attributes.md +++ b/docs/attributes.md @@ -132,6 +132,15 @@ Str::make('name') ->maxLength(20); ``` +#### `enum` + +You can restrict the string to a set of possible values using the `enum` method. + +```php +Str::make('status') + ->enum(['to do', 'doing', 'done']); +``` + #### `pattern` You can also validate the string against a regular expression using the