質問編集履歴

2

コード追記

2022/05/21 06:29

投稿

Fukusuke0604
Fukusuke0604

スコア554

test CHANGED
File without changes
test CHANGED
@@ -54,6 +54,19 @@
54
54
  return view('show', compact('user', 'image'));
55
55
  }
56
56
  ```
57
+ api.php
58
+ ```PHP
59
+ Route::apiResource('/images', 'ImageApiController');
60
+ Route::get('api/images', 'ImageApiController@index')->name('images.index');
61
+ Route::post('api/images', 'ImageApiController@redirect');
62
+ Route::delete('api/images', 'ImageApiController@destroy');
63
+ ```
64
+
65
+ web.php
66
+ ```PHP
67
+ Route::get('show','HomeController@redirect');
68
+ Route::post('show/{image}','HomeController@twitterPost')->name('twitterPost');
69
+ ```
57
70
 
58
71
  上記コードでローカル環境では、投稿完了後にshow.blade.phpにリダイレクトされ、最新の投稿がshow.blade.phpに表示されます。
59
72
 

1

コード修正

2022/05/21 06:07

投稿

Fukusuke0604
Fukusuke0604

スコア554

test CHANGED
File without changes
test CHANGED
@@ -26,8 +26,6 @@
26
26
  $file_name = request()->canvas;
27
27
  $path = Storage::disk('s3')->putFile('/', $file_name, 'public');
28
28
  $image->image = $path;
29
- // request()->canvas->move('storage/images', $path);
30
-
31
29
 
32
30
  //コメント保存処理
33
31
  $image->comment = request('comment');