Skip to content

Commit 5b3f9a9

Browse files
committed
fix:update exists before delete
1 parent 2fd5e46 commit 5b3f9a9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Core/PWA.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace EragLaravelPwa\Core;
44

55
use Illuminate\Http\Request;
6+
use Illuminate\Support\Facades\File;
67
use Illuminate\Validation\ValidationException;
78

89
class PWA
@@ -19,8 +20,8 @@ public static function processLogo(Request $request): array
1920

2021
$destinationPath = public_path('logo.png');
2122

22-
if (file_exists($destinationPath)) {
23-
unlink($destinationPath);
23+
if (File::exists($destinationPath)) {
24+
File::delete($destinationPath);
2425
}
2526

2627
$request->file('logo')->move(public_path(), 'logo.png');

0 commit comments

Comments
 (0)