mirror of
https://github.com/10h30/Test-Laravel-File-Upload.git
synced 2026-07-12 19:26:38 +09:00
Completed all tasks
This commit is contained in:
@@ -25,6 +25,7 @@ class HouseController extends Controller
|
||||
$filename = $request->file('photo')->store('houses');
|
||||
|
||||
// TASK: Delete the old file from the storage
|
||||
Storage::delete('houses', $house->photo);
|
||||
|
||||
$house->update([
|
||||
'name' => $request->name,
|
||||
@@ -38,5 +39,6 @@ class HouseController extends Controller
|
||||
{
|
||||
// TASK: Return the $house->photo file from "storage/app/houses" folder
|
||||
// for download in browser
|
||||
return Storage::download($house->photo);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user