From 26fb5795eb14a662e125072dd153cccdc31d19ba Mon Sep 17 00:00:00 2001 From: andreydruz Date: Thu, 9 Dec 2021 10:56:04 +0200 Subject: [PATCH] How to use repeter with custom table --- v5/models.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/v5/models.md b/v5/models.md index e747f3f..3dbb34d 100644 --- a/v5/models.md +++ b/v5/models.md @@ -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. @@ -905,4 +913,4 @@ Result will be: 'group' => ['name' => ['b' => 'item'], 'age' => 12] ] ] -``` \ No newline at end of file +```