Skip to content

How to use repeter with custom table #15

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion v5/models.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,14 @@ class Doc extends Model
}
```

* if you uising repeter with custom table you need to define cast for your repeater data which will convert serialized string into array. Put this in your Model corresponding for storing data:
```
protected $cast = [
'faq_content' => 'maybe_unserialize'
];
```
After this your repeater should have all values.

## Format

To format a model's values before it is saved, use the `$format` property. Formating can be used to sanitize data being saved to the database.
Expand Down Expand Up @@ -905,4 +913,4 @@ Result will be:
'group' => ['name' => ['b' => 'item'], 'age' => 12]
]
]
```
```