refactor: Update code to use str() instead of Str::of() for string manipulation

This commit is contained in:
Andras Bacsai
2024-06-25 10:37:10 +02:00
parent 1266810c4d
commit 2c92cc40e1
38 changed files with 101 additions and 126 deletions

View File

@@ -4,7 +4,6 @@ namespace App\Models;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Str;
class LocalPersistentVolume extends Model
{
@@ -33,14 +32,14 @@ class LocalPersistentVolume extends Model
protected function name(): Attribute
{
return Attribute::make(
set: fn (string $value) => Str::of($value)->trim()->value,
set: fn (string $value) => str($value)->trim()->value,
);
}
protected function mountPath(): Attribute
{
return Attribute::make(
set: fn (string $value) => Str::of($value)->trim()->start('/')->value
set: fn (string $value) => str($value)->trim()->start('/')->value
);
}
@@ -49,7 +48,7 @@ class LocalPersistentVolume extends Model
return Attribute::make(
set: function (?string $value) {
if ($value) {
return Str::of($value)->trim()->start('/')->value;
return str($value)->trim()->start('/')->value;
} else {
return $value;
}