]> BookStack Code Mirror - bookstack/blobdiff - app/Services/ViewService.php
Added Swedish locale to config
[bookstack] / app / Services / ViewService.php
index 73b353d8f0a989cb40f93b9269e5dcdbb1d0b8bf..770a9e39ffef3387ba10efc975b8749e662e5a5c 100644 (file)
@@ -37,7 +37,7 @@ class ViewService
 
         // Otherwise create new view count
         $entity->views()->save($this->view->create([
-            'user_id' => user()->id,
+            'user_id' => $user->id,
             'views' => 1
         ]));
 
@@ -62,7 +62,7 @@ class ViewService
             $query->whereIn('viewable_type', $filterModel);
         } else if ($filterModel) {
             $query->where('viewable_type', '=', get_class($filterModel));
-        };
+        }
 
         return $query->with('viewable')->skip($skipCount)->take($count)->get()->pluck('viewable');
     }