Skip to content

Commit

Permalink
Update HouseController.php
Browse files Browse the repository at this point in the history
  • Loading branch information
OhmygoodR authored Sep 14, 2024
1 parent 5440a93 commit 263fac3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/Http/Controllers/HouseController.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public function update(Request $request, House $house)
$filename = $request->file('photo')->store('houses');

// TASK: Delete the old file from the storage
Storage::delete($house->photo);

$house->update([
'name' => $request->name,
Expand All @@ -38,5 +39,6 @@ public function download(House $house)
{
// TASK: Return the $house->photo file from "storage/app/houses" folder
// for download in browser
return Storage::download($house->photo);
}
}

0 comments on commit 263fac3

Please sign in to comment.