diff --git a/src/Lib/PathGenerators/DateHashPathGenerator.php b/src/Lib/PathGenerators/DateHashPathGenerator.php index 5cc6ad2..e242cce 100644 --- a/src/Lib/PathGenerators/DateHashPathGenerator.php +++ b/src/Lib/PathGenerators/DateHashPathGenerator.php @@ -16,17 +16,17 @@ class DateHashPathGenerator implements PathGenerator public function generate(DiskName $disk, SanitizedFile $file, ?string $directory = null): StorageFilePath { $extension = pathinfo($file->sanitizedName, PATHINFO_EXTENSION); - $filename = pathinfo($file->sanitizedName, PATHINFO_FILENAME); + $filename = pathinfo($file->sanitizedName, PATHINFO_FILENAME); $sluggedName = Str::slug($filename) ?: 'file'; - $hashPrefix = substr(hash('sha256', $file->sanitizedName), 0, 2); - $uniquePart = substr(bin2hex(random_bytes(4)), 0, 8); + $hashPrefix = substr(hash('sha256', $file->sanitizedName), 0, 2); + $uniquePart = substr(bin2hex(random_bytes(4)), 0, 8); $finalFilename = sprintf( '%s-%s%s', $sluggedName, $uniquePart, - ! empty($extension) ? '.'.$extension : '' + ! empty($extension) ? '.' . $extension : '' ); $pathSegments = array_filter([ diff --git a/src/Lib/PathGenerators/UuidPathGenerator.php b/src/Lib/PathGenerators/UuidPathGenerator.php index 8eba684..84ec14b 100644 --- a/src/Lib/PathGenerators/UuidPathGenerator.php +++ b/src/Lib/PathGenerators/UuidPathGenerator.php @@ -16,9 +16,9 @@ class UuidPathGenerator implements PathGenerator public function generate(DiskName $disk, SanitizedFile $file, ?string $directory = null): StorageFilePath { $extension = pathinfo($file->sanitizedName, PATHINFO_EXTENSION); - $uuid = Str::uuid()->toString(); + $uuid = Str::uuid()->toString(); - $finalFilename = $uuid.(! empty($extension) ? '.'.$extension : ''); + $finalFilename = $uuid . (! empty($extension) ? '.' . $extension : ''); $pathSegments = array_filter([ $directory ? trim($directory, '/') : null,