mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-24 05:04:07 -08:00
Set image to null if model is deleted
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
e8da7e2df2
commit
94c981e22c
|
@ -202,6 +202,7 @@ class AssetModelsController extends Controller
|
|||
if ($model->image) {
|
||||
try {
|
||||
Storage::disk('public')->delete('models/'.$model->image);
|
||||
$model->update(['image' => null]);
|
||||
} catch (\Exception $e) {
|
||||
Log::info($e);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue