Skip to content

Commit

Permalink
Merge pull request #32 from insenseanalytics/master
Browse files Browse the repository at this point in the history
[1.0] Fix custom user model primary key
  • Loading branch information
KABBOUCHI authored Dec 9, 2018
2 parents 9bb2f23 + a6e85ca commit d0265e3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Impersonate.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function __construct($user = null)
if ($user != null) {

if (is_numeric($user) || is_string($user)) {
$this->withMeta(['id' => $user instanceof Model ? $user->id : $user]);
$this->withMeta(['id' => $user instanceof Model ? $user->getKey() : $user]);
} else {
$user = $user instanceof Resource ? $user->resource : $user;

Expand All @@ -38,7 +38,7 @@ public function __construct($user = null)
return;
}

$this->withMeta(['id' => $user instanceof Model ? $user->id : $user]);
$this->withMeta(['id' => $user instanceof Model ? $user->getKey() : $user]);
}

}
Expand Down

0 comments on commit d0265e3

Please sign in to comment.