From 198cd51812ebd317f18ac6d023e1b994c84a5188 Mon Sep 17 00:00:00 2001 From: Fady Mondy Date: Sat, 26 Oct 2024 18:27:42 +0300 Subject: [PATCH] fix path not exists --- src/Services/SaveScan.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Services/SaveScan.php b/src/Services/SaveScan.php index 0b48cbe..ef6925f 100644 --- a/src/Services/SaveScan.php +++ b/src/Services/SaveScan.php @@ -4,6 +4,7 @@ use Carbon\Carbon; use Illuminate\Support\Facades\DB; +use Illuminate\Support\Facades\File; use Illuminate\Support\Facades\Lang; use TomatoPHP\FilamentTranslations\Models\Translation; @@ -19,7 +20,9 @@ public function __construct() public function save() { $scanner = app(Scan::class); - collect($this->paths)->each(function ($path) use ($scanner) { + collect($this->paths)->filter(function($path) { + return File::exists($path); + })->each(function ($path) use ($scanner) { $scanner->addScannedPath($path); });