File tree Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 2525 },
2626 "require" : {
2727 "php" : " ^8.1" ,
28- "statamic/cms" : " ^5.17 "
28+ "statamic/cms" : " ^5.18 "
2929 },
3030 "require-dev" : {
3131 "doctrine/dbal" : " ^3.8" ,
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ public static function fromModel(Model $model)
2121 ->store ($ model ->settings ['store ' ] ?? null )
2222 ->email ($ model ->settings ['email ' ] ?? null )
2323 ->honeypot ($ model ->settings ['honeypot ' ] ?? null )
24+ ->data ($ model ->settings ['data ' ] ?? [])
2425 ->model ($ model );
2526 }
2627
@@ -39,6 +40,7 @@ public static function makeModelFromContract(Contract $source)
3940 'store ' => $ source ->store (),
4041 'email ' => $ source ->email (),
4142 'honeypot ' => $ source ->honeypot (),
43+ 'data ' => $ source ->data (),
4244 ],
4345 ]);
4446 }
Original file line number Diff line number Diff line change 44
55use PHPUnit \Framework \Attributes \Test ;
66use Statamic \Facades ;
7+ use Statamic \Support \Arr ;
78use Tests \TestCase ;
89
910class FormTest extends TestCase
@@ -62,4 +63,12 @@ public function deleting_a_form_removes_the_blink_cache()
6263 $ this ->assertNull (Facades \Blink::get ('eloquent-forms-test ' ));
6364 $ this ->assertNull (Facades \Blink::get ('eloquent-forms ' ));
6465 }
66+
67+ #[Test]
68+ public function it_stores_form_data ()
69+ {
70+ $ form = tap (Facades \Form::make ('test ' )->title ('Test form ' )->data (['some ' => 'data ' ]))->save ();
71+
72+ $ this ->assertSame (['some ' => 'data ' ], Arr::get ($ form ->model (), 'settings.data ' ));
73+ }
6574}
You can’t perform that action at this time.
0 commit comments