This commit is contained in:
2020-08-09 17:37:16 +02:00
parent 644dbd9ea2
commit 2c054b9b79
4 changed files with 9 additions and 9 deletions

View File

@@ -14,7 +14,7 @@ class ImageController extends Controller
public function users(User $user)
{
foreach (auth()->user()->images as $image) {
if(File::exists(storage_path('app/public/'.$image->path))) {
if (File::exists(storage_path('app/public/'.$image->path))) {
File::delete(storage_path('app/public/'.$image->path));
auth()->user()->images()->where('id', $image->id)->delete();
}
@@ -39,7 +39,7 @@ class ImageController extends Controller
public function memos(Memo $memo)
{
foreach ($memo->images as $image) {
if(File::exists(storage_path('app/public/'.$image->path))) {
if (File::exists(storage_path('app/public/'.$image->path))) {
File::delete(storage_path('app/public/'.$image->path));
$memo->images()->where('id', $image->id)->delete();
}