From e441abae4379938113f20b822c749e63d726b992 Mon Sep 17 00:00:00 2001 From: mychidarko Date: Wed, 14 Aug 2024 04:47:37 +0000 Subject: [PATCH] feat: switch auth to new leaf DI --- src/functions.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/functions.php b/src/functions.php index da352f6..7c0654f 100644 --- a/src/functions.php +++ b/src/functions.php @@ -8,11 +8,13 @@ */ function auth() { - if (!(\Leaf\Config::get('auth.instance'))) { - \Leaf\Config::set('auth.instance', new Leaf\Auth()); + if (!(\Leaf\Config::getStatic('auth'))) { + \Leaf\Config::singleton('auth', function () { + return new \Leaf\Auth(); + }); } - return \Leaf\Config::get('auth.instance'); + return \Leaf\Config::getStatic('auth'); } }