Skip to content

Commit

Permalink
throw on filesystem errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jrmajor committed May 4, 2024
1 parent fd2d9e3 commit ab4e226
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
4 changes: 1 addition & 3 deletions app/Images/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@ public static function store(LaravelFile|UploadedFile|string $file, array $attri

$path = static::disk()->putFile(static::uploadPath(), $file, 'private');

if ($path === false) {
throw new Exception('Failed to safe a file.');
}
assert(is_string($path));

/** @var static */
return tap(
Expand Down
8 changes: 4 additions & 4 deletions config/filesystems.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
'local' => [
'driver' => 'local',
'root' => storage_path('app'),
'throw' => false,
'throw' => true,
],

'public' => [
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => env('APP_URL') . '/storage',
'visibility' => 'public',
'throw' => false,
'throw' => true,
],

'media' => [
Expand All @@ -28,7 +28,7 @@
'bucket' => env('S3_BUCKET_MEDIA'),
'endpoint' => env('S3_ENDPOINT'),
'use_path_style_endpoint' => false,
'throw' => false,
'throw' => true,
],

'backup' => [
Expand All @@ -39,7 +39,7 @@
'bucket' => env('S3_BUCKET_BACKUP'),
'endpoint' => env('S3_ENDPOINT'),
'use_path_style_endpoint' => false,
'throw' => false,
'throw' => true,
],

],
Expand Down

0 comments on commit ab4e226

Please sign in to comment.