You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public static function loggedinuser($getShared = true)
{
if ($getShared)
{
return self::getSharedInstance('loggedinuser');
}
return (new UsersModel())->getUserById(session('user_id'));
}
if I call it with $getShared = true, It doesn't work, show NULL with var_dump, if $getShared = false, It works, show the data.
However. I make sure that getSharedInstance doesn't work on custom services, by moving that function into \system\Config\Services.php. The result, that function works well with $getShared = true.
The text was updated successfully, but these errors were encountered:
I have custom service:
public static function loggedinuser($getShared = true)
{
if ($getShared)
{
return self::getSharedInstance('loggedinuser');
}
return (new UsersModel())->getUserById(session('user_id'));
}
if I call it with $getShared = true, It doesn't work, show NULL with var_dump, if $getShared = false, It works, show the data.
However. I make sure that getSharedInstance doesn't work on custom services, by moving that function into \system\Config\Services.php. The result, that function works well with $getShared = true.
The text was updated successfully, but these errors were encountered: