test
This commit is contained in:
@@ -49,18 +49,8 @@ class Controller extends ExController
|
||||
public function update(UpdateRequest $request, UsefulInfo $usefulinfo)
|
||||
{
|
||||
if ($request->hasFile('image')) {
|
||||
if (env('FILESYSTEM_DISK') == 's3') {
|
||||
$imagePath = $usefulinfo->image;
|
||||
Storage::disk('s3')->delete($imagePath);
|
||||
} else {
|
||||
$imagePath = public_path($usefulinfo->image);
|
||||
|
||||
if (File::exists($imagePath)) {
|
||||
File::delete($imagePath);
|
||||
}
|
||||
}
|
||||
|
||||
$path = $request->file('image')->store('uploads/usefulinfos');
|
||||
Storage::delete($usefulinfo->image);
|
||||
$path = $request->file('image')->store('uploads/usefulinfos');
|
||||
} else {
|
||||
$path = $usefulinfo->image;
|
||||
}
|
||||
@@ -84,17 +74,7 @@ class Controller extends ExController
|
||||
$item->delete();
|
||||
}
|
||||
|
||||
if (env('FILESYSTEM_DISK') == 's3') {
|
||||
$imagePath = $usefulinfo->image;
|
||||
Storage::disk('s3')->delete($imagePath);
|
||||
} else {
|
||||
$imagePath = public_path($usefulinfo->image);
|
||||
|
||||
if (File::exists($imagePath)) {
|
||||
File::delete($imagePath);
|
||||
}
|
||||
}
|
||||
|
||||
Storage::delete($usefulinfo->image);
|
||||
$usefulinfo->delete();
|
||||
|
||||
$this->info(trans('admin.messages.deleted'));
|
||||
|
||||
Reference in New Issue
Block a user