Skip to content

Commit 4f501a7

Browse files
committed
chore(doc): [README] update readme
1 parent 34bf42a commit 4f501a7

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,18 @@ class Lead extends Model
148148
After setting up the above configurations, you can proceed with the following steps:
149149

150150
1. Define custom fields using the `CustomField` model.
151-
2. Create leads as usual, but with additional custom fields as you defined in the first step.
151+
2. Create leads as you normally would, but include additional custom fields under the custom key, as defined in the previous step.
152+
```php
153+
[
154+
'phone' => '12345678',
155+
'custom' => [
156+
'zip' => '123'
157+
]
158+
]
159+
160+
```
152161
3. If the custom field value passes validation, it will be stored in the `CustomFieldValue` table.
153-
4. Retrieve custom field values just like any other attribute of the Lead model. For example, you can access a custom field value using `$lead->customField`.
162+
4. Retrieve custom field values just like any other attribute of the Lead model but with the prefix `custom`. For example, you can access a custom field value using `$lead->custom_zip`.
154163

155164
By following these steps, you can seamlessly work with custom fields for the Lead model and access their values as if they were regular attributes.
156165

0 commit comments

Comments
 (0)