refactor: Update code to use str() instead of Str::of() for string manipulation
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user