質問するログイン新規登録

質問編集履歴

1

ソースコードの更新

2020/04/14 14:05

投稿

helloo
helloo

スコア11

title CHANGED
File without changes
body CHANGED
@@ -81,7 +81,7 @@
81
81
  }
82
82
  $v->storeAs($path, $filename);
83
83
  $attachment_data = [
84
- 'path' => Storage::disk('s3'),
84
+ 'path' => $path,
85
85
  'name' => $filename
86
86
  ];
87
87
  $a = new Attachment();
@@ -97,28 +97,6 @@
97
97
  $images->delete();
98
98
  return redirect('/');
99
99
  }
100
-
101
- public function upload(Request $request)
102
- {
103
- $this->validate($request, [
104
- 'file' => [
105
- 'required',
106
- 'file',
107
- 'image',
108
- 'mimes:jpeg,png',
109
- ]
110
- ]);
111
-
112
- if ($request->file('images')->isValid([])) {
113
- $path = Storage::disk('s3')->putFile('/',$form,'public');
114
- return view('stories.index2')->with('filename', basename($path));
115
- } else {
116
- return redirect('/')
117
- ->back()
118
- ->withInput()
119
- ->withErrors();
120
- }
121
- }
122
100
  }
123
101
 
124
102
  ```