Skip to content

Commit

Permalink
Merge pull request #279 from sebastienheyd/master
Browse files Browse the repository at this point in the history
Closes #186
  • Loading branch information
Austin Stierler committed May 22, 2017
2 parents 5a76d29 + 05aedc6 commit 1b7c48b
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/Venturecraft/Revisionable/Revision.php
Expand Up @@ -160,14 +160,16 @@ private function getValue($which = 'new')
return $this->format($this->key, $item->getRevisionUnknownString());
}

// Check if model use RevisionableTrait
if(method_exists($item, 'identifiableName')) {
// see if there's an available mutator
$mutator = 'get' . studly_case($this->key) . 'Attribute';
if (method_exists($item, $mutator)) {
return $this->format($item->$mutator($this->key), $item->identifiableName());
}

// see if there's an available mutator
$mutator = 'get' . studly_case($this->key) . 'Attribute';
if (method_exists($item, $mutator)) {
return $this->format($item->$mutator($this->key), $item->identifiableName());
return $this->format($this->key, $item->identifiableName());
}

return $this->format($this->key, $item->identifiableName());
}
} catch (\Exception $e) {
// Just a fail-safe, in the case the data setup isn't as expected
Expand Down

0 comments on commit 1b7c48b

Please sign in to comment.