Skip to content

Commit

Permalink
Merge pull request #1 from timopaul/patch-1
Browse files Browse the repository at this point in the history
HistoryObserver fix
  • Loading branch information
seancheung authored Jan 6, 2018
2 parents 9e5b0c0 + 377b2c9 commit 564a1f6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "panoscape/history",
"description": "Eloquent model history tracking for Laravel",
"keywords": ["laravel", "log", "history", "tracking", "eloquent", "model"],
"homepage": "https://github.com/panoscape/history",
"homepage": "https://github.com/seancheung/history",
"require": {
"php": ">=5.6.4",
"illuminate/support": "^5.3"
Expand Down
6 changes: 3 additions & 3 deletions src/HistoryObserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,12 @@ public static function getModelName($model)

public static function getUserID()
{
return auth()->check() ? get_class(auth()->user()) : null;
return auth()->check() ? auth()->user()->id : null;
}

public static function getUserType()
{
return auth()->check() ? auth()->user()->id : null;
return auth()->check() ? get_class(auth()->user()) : null;
}

public static function filter($action)
Expand All @@ -119,4 +119,4 @@ public static function filter($action)
return is_null($action) || in_array($action, config('history.events_whitelist'));
}

}
}

0 comments on commit 564a1f6

Please sign in to comment.