You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+11-2Lines changed: 11 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -148,9 +148,18 @@ class Lead extends Model
148
148
After setting up the above configurations, you can proceed with the following steps:
149
149
150
150
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
+
```
152
161
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`.
154
163
155
164
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.
0 commit comments