Skip to content

Commit

Permalink
Merge pull request #197 from VentureCraft/develop
Browse files Browse the repository at this point in the history
Support for Laravel 5.2 in userResponsible()
  • Loading branch information
duellsy committed Jan 13, 2016
2 parents ab29003 + 27c7efa commit 7a3d530
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Venturecraft/Revisionable/Revision.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,13 +194,23 @@ private function getValue($which = 'new')
*/
public function userResponsible()
{
if (empty($this->user_id)) { return false; }
if (class_exists($class = '\Cartalyst\Sentry\Facades\Laravel\Sentry')
|| class_exists($class = '\Cartalyst\Sentinel\Laravel\Facades\Sentinel')
) {
return $class::findUserById($this->user_id);
} else {
$user_model = app('config')->get('auth.model');

if (empty($user_model)) {
$user_model = app('config')->get('auth.providers.users.model');
if (empty($user_model)) {
return false;
}
}
if (!class_exists($user_model)) {
return false;
}
return $user_model::find($this->user_id);
}
}
Expand Down

0 comments on commit 7a3d530

Please sign in to comment.