]> BookStack Code Mirror - bookstack/blobdiff - app/helpers.php
#47 - Fixes the issues with the test case.
[bookstack] / app / helpers.php
index 8103ad1ff9e72033e49abbeff643a27db67e610b..153f1e49fcc0a572dd5463e38c9cc4bc572c9332 100644 (file)
@@ -37,6 +37,15 @@ function user()
     return auth()->user() ?: \BookStack\User::getDefault();
 }
 
+/**
+ * Check if current user is a signed in user.
+ * @return bool
+ */
+function signedInUser()
+{
+    return auth()->user() && !auth()->user()->isDefault();
+}
+
 /**
  * Check if the current user has a permission.
  * If an ownable element is passed in the jointPermissions are checked against
@@ -64,7 +73,7 @@ function userCan($permission, Ownable $ownable = null)
  */
 function setting($key = null, $default = false)
 {
-    $settingService = app(\BookStack\Services\SettingService::class);
+    $settingService = resolve(\BookStack\Services\SettingService::class);
     if (is_null($key)) return $settingService;
     return $settingService->get($key, $default);
 }