mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-12 14:27:33 -08:00
Use proper storage facade for checking if the file exists
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
37d7e89e93
commit
5fd0f56258
|
@ -87,13 +87,11 @@ class UserFilesController extends Controller
|
||||||
|
|
||||||
$full_filename = $rel_path.'/'.$log->filename;
|
$full_filename = $rel_path.'/'.$log->filename;
|
||||||
|
|
||||||
if (file_exists($full_filename)) {
|
if (Storage::exists($rel_path.'/'.$full_filename)) {
|
||||||
Storage::delete($rel_path.'/'.$log->filename);
|
Storage::delete($rel_path.'/'.$full_filename);
|
||||||
|
$log->delete();
|
||||||
return redirect()->back()->with('success', trans('admin/users/message.deletefile.success'));
|
return redirect()->back()->with('success', trans('admin/users/message.deletefile.success'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$log->delete();
|
|
||||||
return redirect()->back()->with('success', trans('admin/users/message.deletefile.success'));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return redirect()->back()->with('error', trans('admin/users/general.log_does_not_exist'));
|
return redirect()->back()->with('error', trans('admin/users/general.log_does_not_exist'));
|
||||||
|
|
Loading…
Reference in a new issue