There is erroneous information in the question:
Access methods of Laravel
do not require a parameter.
Example:
public function getEnderecoCAttribute()
{
return 'Endereço C';
}
And also I did the tests on Laravel 4
and Laravel 5
: both worked correctly.
What do you call "does not work"?
The value is returning NULL
?
This may be because you are returning something that is Null
, or because the model does not exist (accidentally I already added one method to one model, thinking it was another).
Finally, the functionality works as expected.
The test that can be done is you call the method directly
$model->getEnderecoCAttribute();
What does this return? Maybe there's the answer to your problem.