From 37326d5e26cdfcc2810f4664cdd625ea4fd528d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0tancl?= Date: Mon, 15 Jul 2024 16:28:34 +0200 Subject: [PATCH] mention defaultValue() in README --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index d6b57f8..47b192c 100644 --- a/README.md +++ b/README.md @@ -351,6 +351,8 @@ And now the returned color will be correctly transformed: TaskStatus::COMPLETED->color(); // 'text-green-500' ``` +You can also add a `defaultValue()` method to specify the value a case should have if it doesn't use the meta property. That way you can apply the attribute only on some cases and still get a configurable default value on all other cases. + #### Use the `fromMeta()` method ```php TaskStatus::fromMeta(Color::make('green')); // TaskStatus::COMPLETED