Issue
Say I have a model Foo
and I'm mutating an attribute getter, like so:
class Foo extends Model
{
protected $table = 'foo';
public function getSomeBarAttribute($value)
{
return some_function($value);
}
}
Is there a way to access the attribute's raw value, pre-mutation?
Solution
The method you look for is getOriginal. To get the original value you might use:
$this->getOriginal('some_bar');
Answered By - Marcin NabiaĆek
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.