Correctly add photos to S3
This commit is contained in:
parent
842dbfa87b
commit
5bfe8c5a97
3 changed files with 26 additions and 5 deletions
|
@ -141,10 +141,12 @@ class NotesController extends Controller
|
|||
$note->placeLink = '/places/' . $note->place->slug;
|
||||
}
|
||||
|
||||
$note->photoURLs = [];
|
||||
foreach ($note->getMedia() as $photo) {
|
||||
$note->photoURLs[] = $photo->getUrl();
|
||||
$photoURLs = [];
|
||||
$photos = $note->getMedia();
|
||||
foreach ($photos as $photo) {
|
||||
$photoURLs[] = $photo->getUrl();
|
||||
}
|
||||
$note->photoURLs = $photoURLs;
|
||||
|
||||
return view('singlenote', [
|
||||
'note' => $note,
|
||||
|
|
|
@ -64,7 +64,7 @@ class NoteService
|
|||
if ($request->hasFile('photo')) {
|
||||
$files = $request->file('photo');
|
||||
foreach ($files as $file) {
|
||||
$note->addMedia($file)->toMediaLibrary('images', 's3');
|
||||
$note->addMedia($file)->toCollectionOnDisk('images', 's3');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue