Skip to content

Commit

Permalink
nullable
Browse files Browse the repository at this point in the history
  • Loading branch information
PipoCanaja committed Aug 12, 2024
1 parent ca6e1c2 commit e4fb164
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/Models/Component.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,21 +57,21 @@ public function setIgnoreAttribute($ignore)
public function error(): Attribute
{
return Attribute::make(
set: fn (?string $value) => substr($value, 0, 255) ?? null,
set: fn (?string $value) => is_null($value) ? null : substr($value, 0, 255),
);
}

public function label(): Attribute
{
return Attribute::make(
set: fn (?string $value) => substr($value, 0, 255) ?? null,
set: fn (?string $value) => is_null($value) ? null : substr($value, 0, 255),
);
}

public function type(): Attribute
{
return Attribute::make(
set: fn (?string $value) => substr($value, 0, 50) ?? null,
set: fn (?string $value) => is_null($value) ? null : substr($value, 0, 50),
);
}

Expand Down

0 comments on commit e4fb164

Please sign in to comment.