storage url o'zgartirildi
This commit is contained in:
@@ -10,12 +10,17 @@ class Uploads
|
||||
{
|
||||
public static function store(UploadedFile $file, string $path, ?string $disk = null): string
|
||||
{
|
||||
$diskName = $disk ?: config('filesystems.default');
|
||||
$storedPath = $disk ? $file->store($path, $disk) : $file->store($path);
|
||||
|
||||
if (!$storedPath) {
|
||||
throw new RuntimeException("File upload failed: {$path}");
|
||||
}
|
||||
|
||||
if (!Storage::disk($diskName)->exists($storedPath)) {
|
||||
throw new RuntimeException("Uploaded file was not found on disk [{$diskName}]: {$storedPath}");
|
||||
}
|
||||
|
||||
return $storedPath;
|
||||
}
|
||||
|
||||
@@ -28,5 +33,10 @@ class Uploads
|
||||
if (!$stored) {
|
||||
throw new RuntimeException("File upload failed: {$path}");
|
||||
}
|
||||
|
||||
$diskName = $disk ?: config('filesystems.default');
|
||||
if (!Storage::disk($diskName)->exists($path)) {
|
||||
throw new RuntimeException("Uploaded file was not found on disk [{$diskName}]: {$path}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user