回答編集履歴

2

ファイルストレージ利用のパターンを追記

2017/07/29 09:42

投稿

aro10
aro10

スコア4106

test CHANGED
@@ -37,3 +37,23 @@
37
37
  }
38
38
 
39
39
  ```
40
+
41
+
42
+
43
+ ##追記
44
+
45
+ ファイルストレージも試してみたので、利用すると以下のようにできます。
46
+
47
+ ```
48
+
49
+ public function store(Request $request)
50
+
51
+ $input = $request->all();
52
+
53
+ $fileName = $input['fileName']->getClientOriginalName();
54
+
55
+ $path = $request->file('fileName')->storeAs('public',"image/{$fileName}");
56
+
57
+ }
58
+
59
+ ```

1

追記

2017/07/29 09:42

投稿

aro10
aro10

スコア4106

test CHANGED
@@ -13,6 +13,8 @@
13
13
  $fileName = $input['fileName']->getClientOriginalName();
14
14
 
15
15
 
16
+
17
+ #ImageはIntervention Imageライブラリで想定
16
18
 
17
19
  $image = \Image::make($input['fileName']->getRealPath());
18
20