From 0ee49110b62ea7aa4c28ef0a049ce27cf3f2cbbb Mon Sep 17 00:00:00 2001 From: mychidarko Date: Sat, 17 Aug 2024 05:41:18 +0000 Subject: [PATCH] feat: use new fn mode API --- src/functions.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/functions.php b/src/functions.php index 3a7e493..c32903e 100644 --- a/src/functions.php +++ b/src/functions.php @@ -8,10 +8,12 @@ */ function form(): \Leaf\Form { - if (!(\Leaf\Config::get('form.instance'))) { - \Leaf\Config::set('form.instance', new \Leaf\Form()); + if (!(\Leaf\Config::getStatic('form'))) { + \Leaf\Config::singleton('form', function () { + return new \Leaf\Form(); + }); } - return \Leaf\Config::get('form.instance'); + return \Leaf\Config::get('form'); } }