I have a User Eloquent model with attribute phone_1
here are method, but it does not work:
public function getPhone1Attribute($value)
{
xdebug_break();
if ($value !== null) {
return $this->formatPhone($value);
}
return $value;
}
Mutator not working for if starting letter integer.Since mutator take first letter as capital so you cant assign 1 since we cant make interger to capital
suppose if you change phone_1
to phone_one
then it will work
public function getPhoneOneAttribute($value){
}
if you change phone_1
to phone_o1ne
then it will work.since here p and o are letters for that
public function getPhoneO1neAttribute($value){
}