- fix problem with phone number attribute
This commit is contained in:
parent
e049990606
commit
5839ef2a54
@ -8,7 +8,6 @@ use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasOne;
|
||||
|
||||
/**
|
||||
* @property int $id
|
||||
@ -33,7 +32,7 @@ class CV extends Model
|
||||
protected function phoneNumber(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: fn (mixed $value): ?string => str_replace(' ', '', $value ?? ''),
|
||||
get: fn (mixed $value, array $attributes): ?string => str_replace(' ', '', $attributes['phone_number'] ?? ''),
|
||||
);
|
||||
}
|
||||
|
||||
@ -53,4 +52,4 @@ class CV extends Model
|
||||
{
|
||||
return 'token';
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user