From 2752876eb4759d069b591855a9467fc5510f8728 Mon Sep 17 00:00:00 2001 From: kolirt Date: Wed, 4 Sep 2024 00:21:18 +0300 Subject: [PATCH] fix --- composer.json | 2 +- src/MasterModel.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 821c9a9..d485917 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ "fill" ], "license": "MIT", - "version": "3.0.3", + "version": "3.1.3", "authors": [ { "name": "kolirt" diff --git a/src/MasterModel.php b/src/MasterModel.php index 10eec03..fd8adce 100644 --- a/src/MasterModel.php +++ b/src/MasterModel.php @@ -18,7 +18,7 @@ trait MasterModel public $relationsToSave = []; public $priorityRelationsToSave = []; - public $files = []; + public $saved_file_paths = []; /** * Delete the model from the database. @@ -82,7 +82,7 @@ public function fill(array $attributes) $value->move($dir, $imageName); $file_path = $dir_path . $imageName; $attributes[$key] = $file_path; - $this->files[] = $file_path; + $this->saved_file_paths[] = $file_path; try { $path = $this->$key; @@ -215,7 +215,7 @@ public function save(array $options = []) \DB::commit(); } catch (\Exception $e) { - foreach ($this->files as $file) { + foreach ($this->saved_file_paths as $file) { try { $path = $file; if (file_exists(storage_path($path)) && !is_dir(storage_path($path))) {