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?
The method you look for is getOriginal. To get the original value you might use:
$this->getOriginal('some_bar');