mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 21:54:14 -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) {
|
if ($model->image) {
|
||||||
try {
|
try {
|
||||||
Storage::disk('public')->delete('models/'.$model->image);
|
Storage::disk('public')->delete('models/'.$model->image);
|
||||||
|
$model->update(['image' => null]);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
Log::info($e);
|
Log::info($e);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue