{"id":140,"date":"2024-11-29T15:44:45","date_gmt":"2024-11-29T06:44:45","guid":{"rendered":"https:\/\/laravel.satoshis.jp\/?p=140"},"modified":"2025-01-31T16:30:30","modified_gmt":"2025-01-31T07:30:30","slug":"git%e3%81%a8backlog","status":"publish","type":"post","link":"https:\/\/laravel.satoshis.jp\/?p=140","title":{"rendered":"git\u3068Backlog"},"content":{"rendered":"<h4>\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u7ba1\u7406\u306bgit\u3092\u4f7f\u7528\u3059\u308b<\/h4>\n<p>Laravel\u306ebreeze\u307e\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u3089\u3001\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3092git\u3067\u7ba1\u7406\u3059\u308b\u3088\u3046\u306b\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u307e\u305a\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067\u30e6\u30fc\u30b6\u30fc\u540d\u3068\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3092git\u306b\u767b\u9332\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n&gt; git config --global user.name &quot;SAWADA Satoshi&quot;\r\n&gt; git config --global user.email satoshis@example.com\r\n<\/pre>\n<p>VSCode\u306e\u753b\u9762\u306e\u5de6\u5074\u306e\u300cSource Control\u300d\u306e\u30a2\u30a4\u30b3\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/laravel.satoshis.jp\/wp-content\/uploads\/2024\/11\/vscode-git-1.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/laravel.satoshis.jp\/wp-content\/uploads\/2024\/11\/vscode-git-1.png\" alt=\"\" width=\"46\" height=\"275\" class=\"alignnone size-full wp-image-141\" \/><\/a><\/p>\n<p>100\u500b\u4ee5\u4e0a\u306e\u30d5\u30a1\u30a4\u30eb\u304c\u4e26\u3093\u3067\u3044\u307e\u3059\u304c\u3001\u3053\u308c\u3089\u306fLaravel\u3068Breeze\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306b\u3088\u308a\u4f5c\u3089\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u3067\u3059\u3002<\/p>\n<p>Message\u306e\u3068\u3053\u308d\u306b\u300cfirst commit\u300d\u3068\u5165\u529b\u3057\u3066\u9752\u3044Commit\u30dc\u30bf\u30f3\u3092\u62bc\u3057\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u3067\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u304cgit\u306b\u767b\u9332\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u6b21\u306bBacklog\u3068\u306e\u9023\u643a\u3092\u4f5c\u308a\u307e\u3059\u3002<\/p>\n<p>Backlog\u306b\u30a2\u30ab\u30a6\u30f3\u30c8\u3092\u4f5c\u6210\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u30ea\u30f3\u30af\u304b\u3089Backlog\u306e\u30b5\u30a4\u30c8\u3092\u8868\u793a\u3057\u3001\u30d5\u30ea\u30fc\u30d7\u30e9\u30f3\u304b\u3089\u7533\u3057\u8fbc\u307f\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/backlog.com\/ja\/pricing\/\" target=\"_blank\">Backlog<\/a><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/laravel.satoshis.jp\/wp-content\/uploads\/2024\/11\/backlog-free-300x129.png\" alt=\"\" width=\"300\" height=\"129\" class=\"alignnone size-medium wp-image-142\" srcset=\"https:\/\/laravel.satoshis.jp\/wp-content\/uploads\/2024\/11\/backlog-free-300x129.png 300w, https:\/\/laravel.satoshis.jp\/wp-content\/uploads\/2024\/11\/backlog-free-768x331.png 768w, https:\/\/laravel.satoshis.jp\/wp-content\/uploads\/2024\/11\/backlog-free.png 908w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>\u30b9\u30da\u30fc\u30b9\u540d\u306f\u300caiwh#00##\u300d\u3068\u3057\u307e\u3059\u3002\u6700\u521d\u306e # \u306b\u306f\u30af\u30e9\u30b9\u306e\u756a\u53f7\u3092\u3001\u3042\u3068\u306e ## \u306b\u306f\u5b66\u7c4d\u756a\u53f7\u306e\u4e0b2\u6841\u3092\u6307\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>Backlog\u306b\u30ed\u30b0\u30a4\u30f3\u3057\u305f\u3089\u3001\u53f3\u4e0a\u306e\u30a2\u30a4\u30b3\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u30e1\u30cb\u30e5\u30fc\u3092\u8868\u793a\u3057\u300c\u500b\u4eba\u8a2d\u5b9a\u300d\u3092\u9078\u629e\u3057\u307e\u3059\u3002<\/p>\n<p>\u5de6\u306e\u30e1\u30cb\u30e5\u30fc\u304b\u3089\u300c\u30e1\u30fc\u30eb\u8a2d\u5b9a\u300d\u3092\u9078\u629e\u3057\u300c\u901a\u77e5\u3068\u30ec\u30dd\u30fc\u30c8\u3092\u53d7\u4fe1\u3059\u308b\u300d\u306e\u30c1\u30a7\u30c3\u30af\u3092\u5916\u3057\u3066\u300c\u4fdd\u5b58\u300d\u3057\u307e\u3059\u3002<\/p>\n<p>\u53f3\u4e0a\u306e\u30a2\u30a4\u30b3\u30f3\u304b\u3089\u300c\u30b9\u30da\u30fc\u30b9\u8a2d\u5b9a\u300d\u3092\u9078\u629e\u3057\u300c\u30e6\u30fc\u30b6\u30fc\u300d\u3092\u9078\u629e\u3057\u307e\u3059\u3002<\/p>\n<p>\u30e6\u30fc\u30b6\u30fc\u306e\u4e00\u89a7\u753b\u9762\u3067\u300c\u30e6\u30fc\u30b6\u30fc\u8ffd\u52a0\u300d\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u300c\u30e1\u30f3\u30d0\u30fc\u300d\u30a6\u30a3\u30f3\u30c9\u30a6\u304c\u958b\u304f\u306e\u3067\u3001\u300c\u7ba1\u7406\u8005\u300d\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u300c\u6b21\u3078\u300d\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002<\/p>\n<p>\u62db\u5f85\u3059\u308b\u30e1\u30f3\u30d0\u30fc\u306e\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3092\u5165\u529b\u3059\u308b\u3068\u3053\u308d\u3067\u300csatoshis@gmail.com\u300d\u3092\u5165\u529b\u3057\u3066\u300c\u7ba1\u7406\u8005\u30921\u4eba\u62db\u5f85\u3059\u308b\u300d\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002<\/p>\n<p>\u3059\u308b\u3068\u300c1\u4eba\u306e\u30e6\u30fc\u30b6\u30fc\u3092\u62db\u5f85\u3057\u307e\u3057\u305f\u3002\u300d\u3068\u8868\u793a\u3055\u308c\u308b\u306e\u3067\u3001\u300c\u53c2\u52a0\u3055\u305b\u308b\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u300d\u306e\u3068\u3053\u308d\u3067\u300cmesse\u300d\u306b\u30c1\u30a7\u30c3\u30af\u3092\u5165\u308c\u3066\u300c\u767b\u9332\u300d\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002<\/p>\n<h4>Backlog\u3068VSCode\u306e\u9023\u643a<\/h4>\n<p>\u6b21\u306f\u3001Backlog\u306egit\u30ea\u30dd\u30b8\u30c8\u30ea\u3068VSCode\u3092\u9023\u643a\u3055\u305b\u307e\u3059\u3002<\/p>\n<p>Backlog\u306e\u753b\u9762\u3067\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u300cmesse\u300d\u3092\u9078\u629e\u3057\u307e\u3059\u3002<\/p>\n<p>\u5de6\u306e\u30e1\u30cb\u30e5\u30fc\u3067\u300c\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u8a2d\u5b9a\u300d\u3092\u9078\u629e\u3057\u3001\u53f3\u5074\u306e\u753b\u9762\u3092\u5c11\u3057\u4e0b\u306b\u30b9\u30af\u30ed\u30fc\u30eb\u3057\u3066\u300cGit\u3092\u4f7f\u7528\u3059\u308b\u300d\u306b\u30c1\u30a7\u30c3\u30af\u3092\u3057\u3066\u300c\u4fdd\u5b58\u300d\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002<\/p>\n<p>\u300c\u4fdd\u5b58\u300d\u30af\u30ea\u30c3\u30af\u5f8c\u306e\u753b\u9762\u3067\u30b0\u30ec\u30fc\u306e\u30e1\u30cb\u30e5\u30fc\u306e\u300cGit\u300d\u3092\u9078\u629e\u3057\u307e\u3059\u3002<\/p>\n<p>\u300c\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u8ffd\u52a0\u3059\u308b\u300d\u3092\u30af\u30ea\u30c3\u30af\u3057\u300c\u30ea\u30dd\u30b8\u30c8\u30ea\u540d\u300d\u306b\u300cmesse\u300d\u3068\u5165\u529b\u3057\u300c\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u4f5c\u6210\u3059\u308b\u300d\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/laravel.satoshis.jp\/?attachment_id=150\" rel=\"attachment wp-att-150\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/laravel.satoshis.jp\/wp-content\/uploads\/2024\/11\/backlog-git.png\" alt=\"\" width=\"1089\" height=\"408\" class=\"aligncenter size-full wp-image-150\" srcset=\"https:\/\/laravel.satoshis.jp\/wp-content\/uploads\/2024\/11\/backlog-git.png 1089w, https:\/\/laravel.satoshis.jp\/wp-content\/uploads\/2024\/11\/backlog-git-300x112.png 300w, https:\/\/laravel.satoshis.jp\/wp-content\/uploads\/2024\/11\/backlog-git-1024x384.png 1024w, https:\/\/laravel.satoshis.jp\/wp-content\/uploads\/2024\/11\/backlog-git-768x288.png 768w\" sizes=\"auto, (max-width: 1089px) 100vw, 1089px\" \/><\/a><\/p>\n<p>HTTPS\u306e\u53f3\u306bURL\u304c\u8868\u793a\u3057\u3066\u3044\u3066\u3001\u3055\u3089\u306b\u305d\u306e\u53f3\u306e\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068URL\u304c\u30b3\u30d4\u30fc\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>VSCode\u3067\u300cSource Control\u300d\u3092\u9078\u3093\u3067\u53f3\u4e0a\u306e\u300c\u2026\u300d\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u30e1\u30cb\u30e5\u30fc\u304c\u8868\u793a\u3055\u308c\u308b\u306e\u3067\u3001[Remote]-[Add Remote&#8230;]\u3092\u9078\u629e\u3057\u307e\u3059\u3002\u305d\u3053\u306b\u30b3\u30d4\u30fc\u3057\u305fURL\u3092\u8cbc\u308a\u4ed8\u3051\u3066Enter\u3092\u62bc\u3057\u307e\u3059\u3002<\/p>\n<p>\u3055\u3089\u306b\u30ea\u30e2\u30fc\u30c8\u540d\u306e\u5165\u529b\u3092\u6c42\u3081\u3089\u308c\u308b\u306e\u3067\u300corigin\u300d\u3068\u5165\u529b\u3057\u3066Enter\u3057\u307e\u3059\u3002<\/p>\n<p>\u3059\u308b\u3068\u6b21\u306e\u3088\u3046\u306a\u753b\u9762\u304c\u8868\u793a\u3055\u308c\u308b\u306e\u3067\u3001Backlog\u306b\u767b\u9332\u3057\u305f\u30e6\u30fc\u30b6\u30fc\u540d\u3068\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u5165\u529b\u3057\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/laravel.satoshis.jp\/?attachment_id=151\" rel=\"attachment wp-att-151\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/laravel.satoshis.jp\/wp-content\/uploads\/2024\/11\/backlog-git-credential.png\" alt=\"\" width=\"420\" height=\"328\" class=\"aligncenter size-full wp-image-151\" srcset=\"https:\/\/laravel.satoshis.jp\/wp-content\/uploads\/2024\/11\/backlog-git-credential.png 420w, https:\/\/laravel.satoshis.jp\/wp-content\/uploads\/2024\/11\/backlog-git-credential-300x234.png 300w\" sizes=\"auto, (max-width: 420px) 100vw, 420px\" \/><\/a><\/p>\n<h4>Backlog\u3067\u8ab2\u984c\u3092\u4f5c\u6210\u3059\u308b<\/h4>\n<p>Backlog\u306e\u753b\u9762\u3067\u65b0\u3057\u304f\u8ab2\u984c\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<p>\u307e\u305a\u306f\u81ea\u5206\u5b9b\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u9001\u308c\u308b\u3088\u3046\u306b\u3059\u308b\u6a5f\u80fd\u3092\u8ffd\u52a0\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p>\u8ab2\u984c\u306e\u4ef6\u540d\u306b\u300c\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u9001\u4fe1\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b\u300d\u3092\u5165\u529b\u3057\u3001\u62c5\u5f53\u8005\u306b\u81ea\u5206\u3092\u5272\u308a\u5f53\u3066\u3066\u300c\u8ffd\u52a0\u300d\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002<\/p>\n<p>\u6b21\u306bVSCode\u3067 resources\/views\/dashboard.blade.php \u3092\u7de8\u96c6\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: php; first-line: 8; highlight: [12,13,14,15,16,17]; title: ; notranslate\" title=\"\">\r\n    &lt;div class=&quot;py-12&quot;&gt;\r\n        &lt;div class=&quot;max-w-7xl mx-auto sm:px-6 lg:px-8&quot;&gt;\r\n            &lt;div class=&quot;bg-white overflow-hidden shadow-sm sm:rounded-lg&quot;&gt;\r\n                &lt;div class=&quot;p-6 text-gray-900&quot;&gt;\r\n                    &lt;form action=&quot;{{ route(&#039;post&#039;) }}&quot; method=&quot;post&quot;&gt;\r\n                        @csrf\r\n                        &lt;textarea name=&quot;message&quot; required&gt;&lt;\/textarea&gt;\r\n                        &lt;br \/&gt;\r\n                        &lt;button&gt;\u9001\u4fe1\u3059\u308b&lt;\/button&gt;\r\n                    &lt;\/form&gt;\r\n                &lt;\/div&gt;\r\n            &lt;\/div&gt;\r\n        &lt;\/div&gt;\r\n    &lt;\/div&gt;\r\n<\/pre>\n<p>\u3053\u306e\u5909\u66f4\u5185\u5bb9\u3092git\u306b\u767b\u9332\u3057\u307e\u3059\u3002<\/p>\n<p>Backlog\u306e\u8ab2\u984c\u306e\u30da\u30fc\u30b8\u3067\u7dd1\u306e\u30a2\u30a4\u30b3\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/laravel.satoshis.jp\/?attachment_id=154\" rel=\"attachment wp-att-154\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/laravel.satoshis.jp\/wp-content\/uploads\/2024\/11\/backlog-copyicon.png\" alt=\"\" width=\"436\" height=\"114\" class=\"aligncenter size-full wp-image-154\" srcset=\"https:\/\/laravel.satoshis.jp\/wp-content\/uploads\/2024\/11\/backlog-copyicon.png 436w, https:\/\/laravel.satoshis.jp\/wp-content\/uploads\/2024\/11\/backlog-copyicon-300x78.png 300w\" sizes=\"auto, (max-width: 436px) 100vw, 436px\" \/><\/a><\/p>\n<p>VSCode\u306eSOURCE CONTROL\u3067\u3001\u9752\u3044Commit\u306e\u4e0a\u306e\u5165\u529b\u30d5\u30a3\u30fc\u30eb\u30c9\u306b\u30b3\u30d4\u30fc\u3057\u305f\u5185\u5bb9\u3092\u8cbc\u308a\u4ed8\u3051\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/laravel.satoshis.jp\/?attachment_id=155\" rel=\"attachment wp-att-155\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/laravel.satoshis.jp\/wp-content\/uploads\/2024\/11\/vscode-commit-message.png\" alt=\"\" width=\"298\" height=\"226\" class=\"aligncenter size-full wp-image-155\" \/><\/a><\/p>\n<p>\u8cbc\u308a\u4ed8\u3051\u305f\u3089\u9752\u3044Commit\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002<\/p>\n<p>\u9752\u3044\u30dc\u30bf\u30f3\u306e\u8868\u793a\u304cSync Changes\u306b\u5909\u5316\u3059\u308b\u306e\u3067\u3001\u3053\u308c\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002<\/p>\n<p>\u3059\u308b\u3068\u3001\u5909\u66f4\u5185\u5bb9\u304cBacklog\u306egit\u306b\u9001\u4fe1\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>Backlog\u306e\u8ab2\u984c\u3092\u753b\u9762\u3092\u518d\u8aad\u307f\u8fbc\u307f\u3059\u308b\u3068\u3001\u30b3\u30df\u30c3\u30c8\u304c\u8ffd\u52a0\u3055\u308c\u3066\u3044\u308b\u306e\u304c\u308f\u304b\u308a\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/laravel.satoshis.jp\/?attachment_id=156\" rel=\"attachment wp-att-156\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/laravel.satoshis.jp\/wp-content\/uploads\/2024\/11\/backlog-commit.png\" alt=\"\" width=\"442\" height=\"193\" class=\"aligncenter size-full wp-image-156\" srcset=\"https:\/\/laravel.satoshis.jp\/wp-content\/uploads\/2024\/11\/backlog-commit.png 442w, https:\/\/laravel.satoshis.jp\/wp-content\/uploads\/2024\/11\/backlog-commit-300x131.png 300w\" sizes=\"auto, (max-width: 442px) 100vw, 442px\" \/><\/a><\/p>\n<p>\u30b3\u30df\u30c3\u30c8\u306e\u53f3\u5074\u306e\u7dd1\u8272\u306e\u30ea\u30f3\u30af\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u3001\u305d\u306e\u30b3\u30df\u30c3\u30c8\u306b\u3088\u308b\u5909\u66f4\u5185\u5bb9\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/laravel.satoshis.jp\/?attachment_id=157\" rel=\"attachment wp-att-157\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/laravel.satoshis.jp\/wp-content\/uploads\/2024\/11\/backlog-revision.png\" alt=\"\" width=\"725\" height=\"326\" class=\"aligncenter size-full wp-image-157\" srcset=\"https:\/\/laravel.satoshis.jp\/wp-content\/uploads\/2024\/11\/backlog-revision.png 725w, https:\/\/laravel.satoshis.jp\/wp-content\/uploads\/2024\/11\/backlog-revision-300x135.png 300w\" sizes=\"auto, (max-width: 725px) 100vw, 725px\" \/><\/a><\/p>\n<h4>\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u3092\u5b9a\u7fa9\u3059\u308b<\/h4>\n<p>dashboard.blade.php \u5185\u306b\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3092\u8ffd\u52a0\u3057\u305f\u306e\u3067\u3001\u3053\u306e\u307e\u307e\u3067\u306f\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n                    &lt;form action=&quot;{{ route(&#039;post&#039;) }}&quot; method=&quot;post&quot;&gt;\r\n<\/pre>\n<p>routes\/web.php \u306b\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u3092\u5b9a\u7fa9\u3057\u3066\u3001\u30a8\u30e9\u30fc\u3092\u89e3\u6d88\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: php; highlight: [3,15]; title: ; notranslate\" title=\"\">\r\n&lt;?php\r\n\r\nuse App\\Http\\Controllers\\MessageController;\r\nuse App\\Http\\Controllers\\ProfileController;\r\nuse Illuminate\\Support\\Facades\\Route;\r\n\r\nRoute::get(&#039;\/&#039;, function () {\r\n    return view(&#039;welcome&#039;);\r\n});\r\n\r\nRoute::get(&#039;\/dashboard&#039;, function () {\r\n    return view(&#039;dashboard&#039;);\r\n})-&gt;middleware(&#x5B;&#039;auth&#039;, &#039;verified&#039;])-&gt;name(&#039;dashboard&#039;);\r\n\r\nRoute::post(&#039;\/post&#039;, &#x5B;MessageController::class, &#039;post&#039;])-&gt;name(&#039;post&#039;);\r\n\r\nRoute::middleware(&#039;auth&#039;)-&gt;group(function () {\r\n    Route::get(&#039;\/profile&#039;, &#x5B;ProfileController::class, &#039;edit&#039;])-&gt;name(&#039;profile.edit&#039;);\r\n    Route::patch(&#039;\/profile&#039;, &#x5B;ProfileController::class, &#039;update&#039;])-&gt;name(&#039;profile.update&#039;);\r\n    Route::delete(&#039;\/profile&#039;, &#x5B;ProfileController::class, &#039;destroy&#039;])-&gt;name(&#039;profile.destroy&#039;);\r\n});\r\n\r\nrequire __DIR__.&#039;\/auth.php&#039;;\r\n<\/pre>\n<h4>\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\u4f5c\u6210\u3059\u308b<\/h4>\n<p>\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u9001\u4fe1\u3059\u308b\u753b\u9762\u306f\u3067\u304d\u305f\u306e\u3067\u3001\u6b21\u306f\u30b5\u30fc\u30d0\u30fc\u5074\u3067\u5165\u529b\u3092\u53d7\u3051\u53d6\u308b\u305f\u3081\u306e\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<p>\u30bf\u30fc\u30df\u30ca\u30eb\u3067\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n&gt; php artisan make:controller MessageController\r\n<\/pre>\n<p>app\\Http\\Controllers\\MessageController.php \u304c\u4f5c\u3089\u308c\u308b\u306e\u3067\u3001\u3053\u308c\u3092\u4fee\u6b63\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: php; highlight: [9,10,11,12,13,14]; title: ; notranslate\" title=\"\">\r\n&lt;?php\r\n\r\nnamespace App\\Http\\Controllers;\r\n\r\nuse Illuminate\\Http\\Request;\r\n\r\nclass MessageController extends Controller\r\n{\r\n    public function post(Request $request)\r\n    {\r\n        $msg = $request-&gt;input(&#039;message&#039;);\r\n        \\Log::debug($msg);\r\n        return redirect()-&gt;route(&#039;dashboard&#039;);\r\n    }\r\n}\r\n<\/pre>\n<p>\\Log::debug($msg); \u3067\u30ed\u30b0\u306b\u51fa\u529b\u3057\u305f\u5185\u5bb9\u306f\u3001storage\\logs\\laravel.log \u30d5\u30a1\u30a4\u30eb\u3092\u53c2\u7167\u3059\u308b\u3053\u3068\u3067\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/p>\n<h4>\u30e2\u30c7\u30eb\u3092\u4f5c\u6210\u3057\u3066\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u4fdd\u5b58\u3059\u308b<\/h4>\n<p>\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u4fdd\u5b58\u3059\u308b\u305f\u3081\u306e\u30e2\u30c7\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n&gt; php artisan make:model Message -m\r\n<\/pre>\n<p>app\\Models\\Message.php \u3092\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n&lt;?php\r\n\r\nnamespace App\\Models;\r\n\r\nuse Illuminate\\Database\\Eloquent\\Model;\r\n\r\nclass Message extends Model\r\n{\r\n    protected $fillable = &#x5B;\r\n        &#039;sender&#039;,\r\n        &#039;recipient&#039;,\r\n        &#039;text&#039;,\r\n    ];\r\n\r\n}\r\n<\/pre>\n<p>\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u30d5\u30a1\u30a4\u30eb\u3082\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n<p>database\\migrations\\2024_12_15_hhmmss_create_messages_table.php<\/p>\n<pre class=\"brush: php; highlight: [16,17,18]; title: ; notranslate\" title=\"\">\r\n&lt;?php\r\n\r\nuse Illuminate\\Database\\Migrations\\Migration;\r\nuse Illuminate\\Database\\Schema\\Blueprint;\r\nuse Illuminate\\Support\\Facades\\Schema;\r\n\r\nreturn new class extends Migration\r\n{\r\n    \/**\r\n     * Run the migrations.\r\n     *\/\r\n    public function up(): void\r\n    {\r\n        Schema::create(&#039;messages&#039;, function (Blueprint $table) {\r\n            $table-&gt;id();\r\n            $table-&gt;bigInteger(&#039;sender&#039;);\r\n            $table-&gt;bigInteger(&#039;recipient&#039;);\r\n            $table-&gt;text(&#039;text&#039;);\r\n            $table-&gt;timestamps();\r\n        });\r\n    }\r\n\r\n    \/**\r\n     * Reverse the migrations.\r\n     *\/\r\n    public function down(): void\r\n    {\r\n        Schema::dropIfExists(&#039;messages&#039;);\r\n    }\r\n};\r\n<\/pre>\n<p>\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n&gt; php artisan migrate\r\n<\/pre>\n<p>resources\/views\/dashboard.blade.php \u304b\u3089\u5b9b\u5148\u3092\u53d7\u3051\u53d6\u308b\u5fc5\u8981\u304c\u3042\u308b\u306e\u3067\u3001\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<p>\u9001\u4fe1\u8005\u306f\u30ed\u30b0\u30a4\u30f3\u3057\u3066\u3044\u308b\u30e6\u30fc\u30b6\u30fc\u306eID\u3067\u3044\u3044\u306e\u3067\u3059\u304c\u3001\u5b9b\u5148\u306f\u660e\u793a\u7684\u306b\u6307\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u305f\u3060\u3057\u3001\u3053\u3053\u3067\u306f\u81ea\u5206\u5b9b\u306a\u306e\u3067\u30ed\u30b0\u30a4\u30f3\u3057\u3066\u3044\u308b\u30e6\u30fc\u30b6\u30fc\u306eID\u3092\u5b9b\u5148\u306b\u3057\u3066\u3044\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: php; first-line: 8; highlight: [14]; title: ; notranslate\" title=\"\">\r\n    &lt;div class=&quot;py-12&quot;&gt;\r\n        &lt;div class=&quot;max-w-7xl mx-auto sm:px-6 lg:px-8&quot;&gt;\r\n            &lt;div class=&quot;bg-white overflow-hidden shadow-sm sm:rounded-lg&quot;&gt;\r\n                &lt;div class=&quot;p-6 text-gray-900&quot;&gt;\r\n                    &lt;form action=&quot;{{ route(&#039;post&#039;) }}&quot; method=&quot;post&quot;&gt;\r\n                        @csrf\r\n                        &lt;input type=&quot;hidden&quot; name=&quot;recipient&quot; value=&quot;{{ \\Auth::user()-&gt;id }}&quot; \/&gt;\r\n                        &lt;textarea name=&quot;message&quot; required&gt;&lt;\/textarea&gt;\r\n                        &lt;br \/&gt;\r\n                        &lt;button&gt;\u9001\u4fe1\u3059\u308b&lt;\/button&gt;\r\n                    &lt;\/form&gt;\r\n                &lt;\/div&gt;\r\n            &lt;\/div&gt;\r\n        &lt;\/div&gt;\r\n    &lt;\/div&gt;\r\n<\/pre>\n<p>\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3067\u306f\u3001\u53d7\u3051\u53d6\u3063\u305f\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u4fdd\u5b58\u3059\u308b\u51e6\u7406\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: php; highlight: [13,14,15,16,17,18,19]; title: ; notranslate\" title=\"\">\r\n&lt;?php\r\n\r\nnamespace App\\Http\\Controllers;\r\n\r\nuse Illuminate\\Http\\Request;\r\nuse App\\Models\\Message;\r\n\r\nclass MessageController extends Controller\r\n{\r\n    public function post(Request $request)\r\n    {\r\n        $msg = $request-&gt;input(&#039;message&#039;);\r\n        \\Log::debug($msg);\r\n        $sender = \\Auth::user()-&gt;id;\r\n        $recipient = $request-&gt;input(&#039;recipient&#039;);\r\n        Message::create(&#x5B;\r\n            &#039;sender&#039; =&gt; $sender,\r\n            &#039;recipient&#039; =&gt; $recipient,\r\n            &#039;text&#039; =&gt; $msg,\r\n        ]);\r\n        return redirect()-&gt;route(&#039;dashboard&#039;);\r\n    }\r\n}\r\n<\/pre>\n<h4>\u30e6\u30fc\u30b6\u30fc\u4e00\u89a7\u306e\u30da\u30fc\u30b8\u3092\u4f5c\u6210\u3059\u308b<\/h4>\n<p>\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u9001\u4fe1\u3057\u3042\u3046\u306b\u306f\u53cb\u9054\u767b\u9332\u306e\u3088\u3046\u306a\u4ed5\u7d44\u307f\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n<p>Backlog\u3067\u8ab2\u984c\u300c\u30e6\u30fc\u30b6\u30fc\u4e00\u89a7\u306e\u30da\u30fc\u30b8\u3092\u4f5c\u6210\u3059\u308b\u300d\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<p>LINE\u306e\u5834\u5408\u306f\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u306e\u95a2\u4fc2\u3067\u7c21\u5358\u306b\u306f\u63a2\u305b\u306a\u3044\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u304c\u3001\u3053\u3053\u3067\u306f\u30e6\u30fc\u30b6\u30fc\u4e00\u89a7\u306e\u30da\u30fc\u30b8\u3092\u7528\u610f\u3057\u3066\u3001\u30b7\u30b9\u30c6\u30e0\u306b\u767b\u9332\u3057\u3066\u3044\u308b\u30e6\u30fc\u30b6\u30fc\u5168\u54e1\u3092\u8868\u793a\u3059\u308b\u30da\u30fc\u30b8\u304b\u3089\u63a2\u305b\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067view\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n&gt; php artisan make:view userlist\r\n<\/pre>\n<p>\u30e6\u30fc\u30b6\u30fc\u4e00\u89a7\u306e\u30da\u30fc\u30b8\u306e\u5185\u5bb9\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n&lt;x-app-layout&gt;\r\n    &lt;x-slot name=&quot;header&quot;&gt;\r\n        &lt;h2 class=&quot;font-semibold text-xl text-gray-800 leading-tight&quot;&gt;\r\n            {{ __(&#039;\u30e6\u30fc\u30b6\u30fc\u4e00\u89a7&#039;) }}\r\n        &lt;\/h2&gt;\r\n    &lt;\/x-slot&gt;\r\n\r\n    &lt;div class=&quot;py-12&quot;&gt;\r\n        &lt;div class=&quot;max-w-7xl mx-auto sm:px-6 lg:px-8&quot;&gt;\r\n            &lt;div class=&quot;bg-white overflow-hidden shadow-sm sm:rounded-lg&quot;&gt;\r\n                &lt;div class=&quot;p-6 text-gray-900&quot;&gt;\r\n                    @foreach($users as $u)\r\n                    &lt;div&gt;{{ $u-&gt;name }}&lt;\/div&gt;\r\n                    @endforeach\r\n                &lt;\/div&gt;\r\n            &lt;\/div&gt;\r\n        &lt;\/div&gt;\r\n    &lt;\/div&gt;\r\n&lt;\/x-app-layout&gt;\r\n<\/pre>\n<p>\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u3092\u5b9a\u7fa9\u3057\u307e\u3059\u3002<\/p>\n<p>routes\/web.php<\/p>\n<pre class=\"brush: php; highlight: [16]; title: ; notranslate\" title=\"\">\r\n&lt;?php\r\n\r\nuse App\\Http\\Controllers\\MessageController;\r\nuse App\\Http\\Controllers\\ProfileController;\r\nuse Illuminate\\Support\\Facades\\Route;\r\n\r\nRoute::get(&#039;\/&#039;, function () {\r\n    return view(&#039;welcome&#039;);\r\n});\r\n\r\nRoute::get(&#039;\/dashboard&#039;, function () {\r\n    return view(&#039;dashboard&#039;);\r\n})-&gt;middleware(&#x5B;&#039;auth&#039;, &#039;verified&#039;])-&gt;name(&#039;dashboard&#039;);\r\n\r\nRoute::post(&#039;\/post&#039;, &#x5B;MessageController::class, &#039;post&#039;])-&gt;name(&#039;post&#039;);\r\nRoute::get(&#039;\/users&#039;, &#x5B;MessageController::class, &#039;users&#039;])-&gt;name(&#039;users&#039;);\r\n\r\nRoute::middleware(&#039;auth&#039;)-&gt;group(function () {\r\n    Route::get(&#039;\/profile&#039;, &#x5B;ProfileController::class, &#039;edit&#039;])-&gt;name(&#039;profile.edit&#039;);\r\n    Route::patch(&#039;\/profile&#039;, &#x5B;ProfileController::class, &#039;update&#039;])-&gt;name(&#039;profile.update&#039;);\r\n    Route::delete(&#039;\/profile&#039;, &#x5B;ProfileController::class, &#039;destroy&#039;])-&gt;name(&#039;profile.destroy&#039;);\r\n});\r\n\r\nrequire __DIR__.&#039;\/auth.php&#039;;\r\n<\/pre>\n<p>\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u306b users() \u30e1\u30bd\u30c3\u30c9\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: php; highlight: [25,26,27,28,29]; title: ; notranslate\" title=\"\">\r\n&lt;?php\r\n\r\nnamespace App\\Http\\Controllers;\r\n\r\nuse Illuminate\\Http\\Request;\r\nuse App\\Models\\Message;\r\nuse App\\Models\\User;\r\n\r\nclass MessageController extends Controller\r\n{\r\n    public function post(Request $request)\r\n    {\r\n        $msg = $request-&gt;input(&#039;message&#039;);\r\n        \\Log::debug($msg);\r\n        $sender = \\Auth::user()-&gt;id;\r\n        $recipient = $request-&gt;input(&#039;recipient&#039;);\r\n        Message::create(&#x5B;\r\n            &#039;sender&#039; =&gt; $sender,\r\n            &#039;recipient&#039; =&gt; $recipient,\r\n            &#039;text&#039; =&gt; $msg,\r\n        ]);\r\n        return redirect()-&gt;route(&#039;dashboard&#039;);\r\n    }\r\n\r\n    public function users()\r\n    {\r\n        $users = User::orderBy(&#039;created_at&#039;, &#039;desc&#039;)-&gt;get();\r\n        return view(&#039;userlist&#039;, compact(&#039;users&#039;));\r\n    }\r\n}\r\n<\/pre>\n<p>dashboard.blade.php \u306b\u3001\u30e6\u30fc\u30b6\u30fc\u4e00\u89a7\u306e\u30da\u30fc\u30b8\u3078\u306e\u30ea\u30f3\u30af\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: php; first-line: 8; highlight: [20,21,22]; title: ; notranslate\" title=\"\">\r\n    &lt;div class=&quot;py-12&quot;&gt;\r\n        &lt;div class=&quot;max-w-7xl mx-auto sm:px-6 lg:px-8&quot;&gt;\r\n            &lt;div class=&quot;bg-white overflow-hidden shadow-sm sm:rounded-lg&quot;&gt;\r\n                &lt;div class=&quot;p-6 text-gray-900&quot;&gt;\r\n                    &lt;form action=&quot;{{ route(&#039;post&#039;) }}&quot; method=&quot;post&quot;&gt;\r\n                        @csrf\r\n                        &lt;input type=&quot;hidden&quot; name=&quot;recipient&quot; value=&quot;{{ \\Auth::user()-&gt;id }}&quot; \/&gt;\r\n                        &lt;textarea name=&quot;message&quot; required&gt;&lt;\/textarea&gt;\r\n                        &lt;br \/&gt;\r\n                        &lt;button&gt;\u9001\u4fe1\u3059\u308b&lt;\/button&gt;\r\n                    &lt;\/form&gt;\r\n                &lt;\/div&gt;\r\n                &lt;div&gt;\r\n                    &lt;a href=&quot;{{ route(&#039;users&#039;) }}&quot;&gt;\u30e6\u30fc\u30b6\u30fc\u4e00\u89a7&lt;\/a&gt;\r\n                &lt;\/div&gt;\r\n            &lt;\/div&gt;\r\n        &lt;\/div&gt;\r\n    &lt;\/div&gt;\r\n<\/pre>\n<p>\u52d5\u4f5c\u78ba\u8a8d\u304c\u3067\u304d\u305f\u3089\u3001\u30b3\u30df\u30c3\u30c8\u3057\u3066\u540c\u671f\u3057\u307e\u3059\u3002<\/p>\n<p>Backlog\u306e\u8ab2\u984c\u306e\u30da\u30fc\u30b8\u306b\u30b3\u30df\u30c3\u30c8\u304c\u8ffd\u52a0\u3055\u308c\u307e\u3059\u3002<\/p>\n<h4>\u30e6\u30fc\u30b6\u30fc\u4e00\u89a7\u3067\u5404\u30e6\u30fc\u30b6\u30fc\u306e\u72b6\u614b\u3092\u8868\u793a\u3059\u308b<\/h4>\n<p>\u73fe\u5728\u306e\u30e6\u30fc\u30b6\u30fc\u4e00\u89a7\u30da\u30fc\u30b8\u3067\u306f\u3001\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u306e\u304c\u81ea\u5206\u306a\u306e\u304b\u3001\u53cb\u9054\u306a\u306e\u304b\u3001\u53cb\u9054\u306b\u306a\u3063\u3066\u3044\u306a\u3044\u306e\u304b\u304c\u308f\u304b\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>\u81ea\u5206\u3060\u3063\u305f\u3089\u300c\u3042\u306a\u305f\u3067\u3059\u300d\u3068\u8868\u793a\u3059\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<p>\u53cb\u9054\u7533\u8acb\u306e\u4ed5\u7d44\u307f\u304c\u306a\u3044\u306e\u3067\u3001\u53cb\u9054\u306f\u3072\u3068\u308a\u3082\u3044\u306a\u3044\u72b6\u614b\u306a\u306e\u3067\u3001\u81ea\u5206\u4ee5\u5916\u306b\u306f\u300c\u3068\u3082\u3060\u3061\u7533\u8acb\u300d\u306e\u30dc\u30bf\u30f3\u3092\u8868\u793a\u3059\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<p>\u307e\u305a\u306fBacklog\u3067\u8ab2\u984c\u300c\u30e6\u30fc\u30b6\u30fc\u4e00\u89a7\u3067\u5404\u30e6\u30fc\u30b6\u30fc\u306e\u72b6\u614b\u3092\u8868\u793a\u3059\u308b\u300d\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<p>userlist.blade.php \u3092\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: php; highlight: [13,14,15,16,17,18,19,20]; title: ; notranslate\" title=\"\">\r\n&lt;x-app-layout&gt;\r\n    &lt;x-slot name=&quot;header&quot;&gt;\r\n        &lt;h2 class=&quot;font-semibold text-xl text-gray-800 leading-tight&quot;&gt;\r\n            {{ __(&#039;\u30e6\u30fc\u30b6\u30fc\u4e00\u89a7&#039;) }}\r\n        &lt;\/h2&gt;\r\n    &lt;\/x-slot&gt;\r\n\r\n    &lt;div class=&quot;py-12&quot;&gt;\r\n        &lt;div class=&quot;max-w-7xl mx-auto sm:px-6 lg:px-8&quot;&gt;\r\n            &lt;div class=&quot;bg-white overflow-hidden shadow-sm sm:rounded-lg&quot;&gt;\r\n                &lt;div class=&quot;p-6 text-gray-900&quot;&gt;\r\n                    @foreach($users as $u)\r\n                    &lt;div&gt;\r\n                        {{ $u-&gt;name }}\r\n                        @if(\\Auth::user()-&gt;id == $u-&gt;id)\r\n                        \u3042\u306a\u305f\u3067\u3059\uff01\r\n                        @else\r\n                        &lt;button&gt;\u3068\u3082\u3060\u3061\u7533\u8acb&lt;\/button&gt;\r\n                        @endif\r\n                    &lt;\/div&gt;\r\n                    @endforeach\r\n                &lt;\/div&gt;\r\n            &lt;\/div&gt;\r\n        &lt;\/div&gt;\r\n    &lt;\/div&gt;\r\n&lt;\/x-app-layout&gt;\r\n<\/pre>\n<p>\u3068\u3082\u3060\u3061\u7533\u8acb\u306e\u30dc\u30bf\u30f3\u304c\u30dc\u30bf\u30f3\u3063\u307d\u304f\u306a\u3044\u306e\u3067CSS\u3067\u5c11\u3057\u30c7\u30b6\u30a4\u30f3\u3092\u8abf\u6574\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: xml; first-line: 11; highlight: [13,18]; title: ; notranslate\" title=\"\">\r\n                &lt;div class=&quot;p-6 text-gray-900&quot;&gt;\r\n                    @foreach($users as $u)\r\n                    &lt;div class=&quot;username-div&quot;&gt;\r\n                        {{ $u-&gt;name }}\r\n                        @if(\\Auth::user()-&gt;id == $u-&gt;id)\r\n                        \u3042\u306a\u305f\u3067\u3059\uff01\r\n                        @else\r\n                        &lt;button class=&quot;friend-button&quot;&gt;\u3068\u3082\u3060\u3061\u7533\u8acb&lt;\/button&gt;\r\n                        @endif\r\n                    &lt;\/div&gt;\r\n                    @endforeach\r\n                &lt;\/div&gt;\r\n<\/pre>\n<p>CSS\u306f layouts\/app.blade.php \u306b\u8a18\u8ff0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: xml; highlight: [13,14,15,16,17,18,19,20,21,22,23]; title: ; notranslate\" title=\"\">\r\n&lt;!DOCTYPE html&gt;\r\n&lt;html lang=&quot;{{ str_replace(&#039;_&#039;, &#039;-&#039;, app()-&gt;getLocale()) }}&quot;&gt;\r\n    &lt;head&gt;\r\n        &lt;meta charset=&quot;utf-8&quot;&gt;\r\n        &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;&gt;\r\n        &lt;meta name=&quot;csrf-token&quot; content=&quot;{{ csrf_token() }}&quot;&gt;\r\n\r\n        &lt;title&gt;{{ config(&#039;app.name&#039;, &#039;Laravel&#039;) }}&lt;\/title&gt;\r\n\r\n        &lt;!-- Fonts --&gt;\r\n        &lt;link rel=&quot;preconnect&quot; href=&quot;https:\/\/fonts.bunny.net&quot;&gt;\r\n        &lt;link href=&quot;https:\/\/fonts.bunny.net\/css?family=figtree:400,500,600&amp;display=swap&quot; rel=&quot;stylesheet&quot; \/&gt;\r\n        &lt;style&gt;\r\n        .username-div {\r\n            margin: 2px;\r\n        }\r\n        .friend-button {\r\n            font-size: small;\r\n            background-color: #b9f9f3;\r\n            border-radius: 5px;\r\n            padding: 3px 5px;\r\n        }\r\n        &lt;\/style&gt;\r\n        &lt;!-- Scripts --&gt;\r\n        @vite(&#x5B;&#039;resources\/css\/app.css&#039;, &#039;resources\/js\/app.js&#039;])\r\n<\/pre>\n<p>\u30dc\u30bf\u30f3\u3092 form \u30bf\u30b0\u5185\u306b\u914d\u7f6e\u3057\u3066\u3001\u8ab0\u306b\u5bfe\u3057\u3066\u3068\u3082\u3060\u3061\u7533\u8acb\u3059\u308b\u306e\u304b\u3092\u308f\u304b\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: xml; first-line: 11; highlight: [15,16,18,19,20,21,22,23]; title: ; notranslate\" title=\"\">\r\n                &lt;div class=&quot;p-6 text-gray-900&quot;&gt;\r\n                    @foreach($users as $u)\r\n                    &lt;div class=&quot;username-div&quot;&gt;\r\n                        @if(\\Auth::user()-&gt;id == $u-&gt;id)\r\n                        {{ $u-&gt;name }}\r\n                        \u3042\u306a\u305f\u3067\u3059\uff01\r\n                        @else\r\n                        &lt;form action=&quot;{{ route(&#039;friend-request&#039;) }}&quot; method=&quot;post&quot;&gt;\r\n                            @csrf\r\n                            {{ $u-&gt;name }}\r\n                            &lt;input type=&quot;hidden&quot; name=&quot;id&quot; value=&quot;{{ $u-&gt;id }}&quot; \/&gt;\r\n                            &lt;button class=&quot;friend-button&quot;&gt;\u3068\u3082\u3060\u3061\u7533\u8acb&lt;\/button&gt;\r\n                        &lt;\/form&gt;\r\n                        @endif\r\n                    &lt;\/div&gt;\r\n                    @endforeach\r\n                &lt;\/div&gt;\r\n<\/pre>\n<p>action\u5c5e\u6027\u306b\u5bfe\u5fdc\u3059\u308b\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u3092\u5b9a\u7fa9\u3057\u307e\u3059\u3002<\/p>\n<p>routes\/web.php<\/p>\n<pre class=\"brush: php; highlight: [17]; title: ; notranslate\" title=\"\">\r\n&lt;?php\r\n\r\nuse App\\Http\\Controllers\\MessageController;\r\nuse App\\Http\\Controllers\\ProfileController;\r\nuse Illuminate\\Support\\Facades\\Route;\r\n\r\nRoute::get(&#039;\/&#039;, function () {\r\n    return view(&#039;welcome&#039;);\r\n});\r\n\r\nRoute::get(&#039;\/dashboard&#039;, function () {\r\n    return view(&#039;dashboard&#039;);\r\n})-&gt;middleware(&#x5B;&#039;auth&#039;, &#039;verified&#039;])-&gt;name(&#039;dashboard&#039;);\r\n\r\nRoute::post(&#039;\/post&#039;, &#x5B;MessageController::class, &#039;post&#039;])-&gt;name(&#039;post&#039;);\r\nRoute::get(&#039;\/users&#039;, &#x5B;MessageController::class, &#039;users&#039;])-&gt;name(&#039;users&#039;);\r\nRoute::post(&#039;\/friend-request&#039;, &#x5B;MessageController::class, &#039;friendRequest&#039;])-&gt;name(&#039;friend-request&#039;);\r\n\r\nRoute::middleware(&#039;auth&#039;)-&gt;group(function () {\r\n    Route::get(&#039;\/profile&#039;, &#x5B;ProfileController::class, &#039;edit&#039;])-&gt;name(&#039;profile.edit&#039;);\r\n    Route::patch(&#039;\/profile&#039;, &#x5B;ProfileController::class, &#039;update&#039;])-&gt;name(&#039;profile.update&#039;);\r\n    Route::delete(&#039;\/profile&#039;, &#x5B;ProfileController::class, &#039;destroy&#039;])-&gt;name(&#039;profile.destroy&#039;);\r\n});\r\n\r\nrequire __DIR__.&#039;\/auth.php&#039;;\r\n<\/pre>\n<p>\u3068\u3082\u3060\u3061\u7533\u8acb\u306e\u30dc\u30bf\u30f3\u304c\u62bc\u3055\u308c\u305f\u3089\u3001\u4f55\u3082\u305b\u305a\u306b\u5143\u306e\u30da\u30fc\u30b8\u306b\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3059\u308b\u3088\u3046\u306b\u3001MessageController.php \u3092\u4fee\u6b63\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: php; highlight: [31,32,33,34]; title: ; notranslate\" title=\"\">\r\n&lt;?php\r\n\r\nnamespace App\\Http\\Controllers;\r\n\r\nuse Illuminate\\Http\\Request;\r\nuse App\\Models\\Message;\r\nuse App\\Models\\User;\r\n\r\nclass MessageController extends Controller\r\n{\r\n    public function post(Request $request)\r\n    {\r\n        $msg = $request-&gt;input(&#039;message&#039;);\r\n        \\Log::debug($msg);\r\n        $sender = \\Auth::user()-&gt;id;\r\n        $recipient = $request-&gt;input(&#039;recipient&#039;);\r\n        Message::create(&#x5B;\r\n            &#039;sender&#039; =&gt; $sender,\r\n            &#039;recipient&#039; =&gt; $recipient,\r\n            &#039;text&#039; =&gt; $msg,\r\n        ]);\r\n        return redirect()-&gt;route(&#039;dashboard&#039;);\r\n    }\r\n\r\n    public function users()\r\n    {\r\n        $users = User::orderBy(&#039;created_at&#039;, &#039;desc&#039;)-&gt;get();\r\n        return view(&#039;userlist&#039;, compact(&#039;users&#039;));\r\n    }\r\n\r\n    public function friendRequest(Request $request)\r\n    {\r\n        return redirect()-&gt;route(&#039;users&#039;);\r\n    }\r\n}\r\n<\/pre>\n<p>\u3068\u3082\u3060\u3061\u7533\u8acb\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u4fdd\u5b58\u3059\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<p>FriendRequest\u30e2\u30c7\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n&gt; php artisan make:model FriendRequest -m\r\n<\/pre>\n<p>FriendRequest\u30e2\u30c7\u30eb\u306f\u3001\u7533\u8acb\u3092\u9001\u4fe1\u3057\u305f\u4eba\u3068\u8ab0\u306b\u7533\u8acb\u3057\u305f\u306e\u304b\u3068\u3044\u3046\u60c5\u5831\u304c\u3042\u308c\u3070\u3088\u3055\u305d\u3046\u306a\u306e\u3067\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u4fee\u6b63\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n&lt;?php\r\n\r\nnamespace App\\Models;\r\n\r\nuse Illuminate\\Database\\Eloquent\\Model;\r\n\r\nclass FriendRequest extends Model\r\n{\r\n    protected $fillable = &#x5B;\r\n        &#039;sender&#039;,\r\n        &#039;recipient&#039;,\r\n    ];\r\n}\r\n<\/pre>\n<p>2024_12_13_hhmmss_create_friend_requests_table.php<\/p>\n<pre class=\"brush: php; highlight: [16,17]; title: ; notranslate\" title=\"\">\r\n&lt;?php\r\n\r\nuse Illuminate\\Database\\Migrations\\Migration;\r\nuse Illuminate\\Database\\Schema\\Blueprint;\r\nuse Illuminate\\Support\\Facades\\Schema;\r\n\r\nreturn new class extends Migration\r\n{\r\n    \/**\r\n     * Run the migrations.\r\n     *\/\r\n    public function up(): void\r\n    {\r\n        Schema::create(&#039;friend_requests&#039;, function (Blueprint $table) {\r\n            $table-&gt;id();\r\n            $table-&gt;bigInteger(&#039;sender&#039;);\r\n            $table-&gt;bigInteger(&#039;recipient&#039;);\r\n            $table-&gt;timestamps();\r\n        });\r\n    }\r\n\r\n    \/**\r\n     * Reverse the migrations.\r\n     *\/\r\n    public function down(): void\r\n    {\r\n        Schema::dropIfExists(&#039;friend_requests&#039;);\r\n    }\r\n};\r\n<\/pre>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n&gt; php artisan migrate\r\n<\/pre>\n<p>\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3067\u3068\u3082\u3060\u3061\u7533\u8acb\u3092\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u4fdd\u5b58\u3059\u308b\u3088\u3046\u306b\u4fee\u6b63\u3057\u307e\u3059\u3002<\/p>\n<p>MessageController<\/p>\n<pre class=\"brush: php; first-line: 32; highlight: [34,35,36,37,38,39]; title: ; notranslate\" title=\"\">\r\n    public function friendRequest(Request $request)\r\n    {\r\n        $sender = \\Auth::user()-&gt;id;\r\n        $recipient = $request-&gt;input(&#039;id&#039;);\r\n        FriendRequest::create(&#x5B;\r\n            &#039;sender&#039; =&gt; $sender,\r\n            &#039;recipient&#039; =&gt; $recipient,\r\n        ]);\r\n        return redirect()-&gt;route(&#039;users&#039;);\r\n    }\r\n<\/pre>\n<p>User\u30af\u30e9\u30b9\u3067FriendRequest\u3092\u53d6\u5f97\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: php; first-line: 37; highlight: [50,51,52,53]; title: ; notranslate\" title=\"\">\r\n    \/**\r\n     * Get the attributes that should be cast.\r\n     *\r\n     * @return array&lt;string, string&gt;\r\n     *\/\r\n    protected function casts(): array\r\n    {\r\n        return &#x5B;\r\n            &#039;email_verified_at&#039; =&gt; &#039;datetime&#039;,\r\n            &#039;password&#039; =&gt; &#039;hashed&#039;,\r\n        ];\r\n    }\r\n\r\n    public function friendRequest($recipient)\r\n    {\r\n        return FriendRequest::where(&#039;sender&#039;, $this-&gt;id)-&gt;where(&#039;recipient&#039;, $recipient)-&gt;first();\r\n    }\r\n}\r\n<\/pre>\n<p>userlist.blade.php \u3067\u306f\u3001\u3068\u3082\u3060\u3061\u7533\u8acb\u6e08\u306e\u4eba\u306f\u300c\u3068\u3082\u3060\u3061\u7533\u8acb\u4e2d\u300d\u3068\u8868\u793a\u3059\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: xml; first-line: 11; highlight: [18,25,26,27,28,29]; title: ; notranslate\" title=\"\">\r\n                &lt;div class=&quot;p-6 text-gray-900&quot;&gt;\r\n                    @foreach($users as $u)\r\n                    &lt;div class=&quot;username-div&quot;&gt;\r\n                        @if(\\Auth::user()-&gt;id == $u-&gt;id)\r\n                        {{ $u-&gt;name }}\r\n                        \u3042\u306a\u305f\u3067\u3059\uff01\r\n                        @else\r\n                        @if(empty(\\Auth::user()-&gt;friendRequest($u-&gt;id)))\r\n                        &lt;form action=&quot;{{ route(&#039;friend-request&#039;) }}&quot; method=&quot;post&quot;&gt;\r\n                            @csrf\r\n                            {{ $u-&gt;name }}\r\n                            &lt;input type=&quot;hidden&quot; name=&quot;id&quot; value=&quot;{{ $u-&gt;id }}&quot; \/&gt;\r\n                            &lt;button class=&quot;friend-button&quot;&gt;\u3068\u3082\u3060\u3061\u7533\u8acb&lt;\/button&gt;\r\n                        &lt;\/form&gt;\r\n                        @else\r\n                        {{ $u-&gt;name }}\r\n                        &lt;span class=&quot;wait-accept&quot;&gt;\u3068\u3082\u3060\u3061\u7533\u8acb\u4e2d&lt;\/span&gt;\r\n                        @endif\r\n                        @endif\r\n                    &lt;\/div&gt;\r\n                    @endforeach\r\n                &lt;\/div&gt;\r\n<\/pre>\n<p>\u3068\u3082\u3060\u3061\u7533\u8acb\u3092\u627f\u8a8d\u3059\u308b\u30dc\u30bf\u30f3\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: xml; first-line: 11; highlight: [19,26,27,28,29,30,31,32,33]; title: ; notranslate\" title=\"\">\r\n                &lt;div class=&quot;p-6 text-gray-900&quot;&gt;\r\n                    @foreach($users as $u)\r\n                    &lt;div class=&quot;username-div&quot;&gt;\r\n                        @if(\\Auth::user()-&gt;id == $u-&gt;id)\r\n                        {{ $u-&gt;name }}\r\n                        \u3042\u306a\u305f\u3067\u3059\uff01\r\n                        @else\r\n                        @if(empty(\\Auth::user()-&gt;friendRequest($u-&gt;id)))\r\n                        @if(empty(\\Auth::user()-&gt;requestReceived($u-&gt;id)))\r\n                        &lt;form action=&quot;{{ route(&#039;friend-request&#039;) }}&quot; method=&quot;post&quot;&gt;\r\n                            @csrf\r\n                            {{ $u-&gt;name }}\r\n                            &lt;input type=&quot;hidden&quot; name=&quot;id&quot; value=&quot;{{ $u-&gt;id }}&quot; \/&gt;\r\n                            &lt;button class=&quot;friend-button&quot;&gt;\u3068\u3082\u3060\u3061\u7533\u8acb&lt;\/button&gt;\r\n                        &lt;\/form&gt;\r\n                        @else\r\n                        &lt;form action=&quot;&quot; method=&quot;post&quot;&gt;\r\n                            @csrf\r\n                            {{ $u-&gt;name}}\r\n                            &lt;span class=&quot;request-received&quot;&gt;\u3068\u3082\u3060\u3061\u7533\u8acb\u3092\u53d7\u3051\u53d6\u308a\u307e\u3057\u305f&lt;\/span&gt;\r\n                            &lt;button class=&quot;friend-button&quot;&gt;\u627f\u8a8d\u3059\u308b&lt;\/button&gt;\r\n                        &lt;\/form&gt;\r\n                        @endif\r\n                        @else\r\n                        {{ $u-&gt;name }}\r\n                        &lt;span class=&quot;wait-accept&quot;&gt;\u3068\u3082\u3060\u3061\u7533\u8acb\u4e2d&lt;\/span&gt;\r\n                        @endif\r\n                        @endif\r\n                    &lt;\/div&gt;\r\n                    @endforeach\r\n                &lt;\/div&gt;\r\n<\/pre>\n<p>\u3068\u3082\u3060\u3061\u3092\u627f\u8a8d\u3059\u308b\u305f\u3081\u306e\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u3092\u7528\u610f\u3059\u308b\u3002<\/p>\n<pre class=\"brush: php; highlight: [18]; title: ; notranslate\" title=\"\">\r\n&lt;?php\r\n\r\nuse App\\Http\\Controllers\\MessageController;\r\nuse App\\Http\\Controllers\\ProfileController;\r\nuse Illuminate\\Support\\Facades\\Route;\r\n\r\nRoute::get(&#039;\/&#039;, function () {\r\n    return view(&#039;welcome&#039;);\r\n});\r\n\r\nRoute::get(&#039;\/dashboard&#039;, function () {\r\n    return view(&#039;dashboard&#039;);\r\n})-&gt;middleware(&#x5B;&#039;auth&#039;, &#039;verified&#039;])-&gt;name(&#039;dashboard&#039;);\r\n\r\nRoute::post(&#039;\/post&#039;, &#x5B;MessageController::class, &#039;post&#039;])-&gt;name(&#039;post&#039;);\r\nRoute::get(&#039;\/users&#039;, &#x5B;MessageController::class, &#039;users&#039;])-&gt;name(&#039;users&#039;);\r\nRoute::post(&#039;\/friend-request&#039;, &#x5B;MessageController::class, &#039;friendRequest&#039;])-&gt;name(&#039;friend-request&#039;);\r\nRoute::post(&#039;\/request-accept&#039;, &#x5B;MessageController::class, &#039;acceptRequest&#039;])-&gt;name(&#039;request-accept&#039;);\r\n\r\nRoute::middleware(&#039;auth&#039;)-&gt;group(function () {\r\n    Route::get(&#039;\/profile&#039;, &#x5B;ProfileController::class, &#039;edit&#039;])-&gt;name(&#039;profile.edit&#039;);\r\n    Route::patch(&#039;\/profile&#039;, &#x5B;ProfileController::class, &#039;update&#039;])-&gt;name(&#039;profile.update&#039;);\r\n    Route::delete(&#039;\/profile&#039;, &#x5B;ProfileController::class, &#039;destroy&#039;])-&gt;name(&#039;profile.destroy&#039;);\r\n});\r\n\r\nrequire __DIR__.&#039;\/auth.php&#039;;\r\n<\/pre>\n<p>userlist.blade.php \u306b\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u3092\u8a18\u5165\u3059\u308b\u3002<\/p>\n<pre class=\"brush: xml; first-line: 11; highlight: [27]; title: ; notranslate\" title=\"\">\r\n                &lt;div class=&quot;p-6 text-gray-900&quot;&gt;\r\n                    @foreach($users as $u)\r\n                    &lt;div class=&quot;username-div&quot;&gt;\r\n                        @if(\\Auth::user()-&gt;id == $u-&gt;id)\r\n                        {{ $u-&gt;name }}\r\n                        \u3042\u306a\u305f\u3067\u3059\uff01\r\n                        @else\r\n                        @if(empty(\\Auth::user()-&gt;friendRequest($u-&gt;id)))\r\n                        @if(empty(\\Auth::user()-&gt;requestReceived($u-&gt;id)))\r\n                        &lt;form action=&quot;{{ route(&#039;friend-request&#039;) }}&quot; method=&quot;post&quot;&gt;\r\n                            @csrf\r\n                            {{ $u-&gt;name }}\r\n                            &lt;input type=&quot;hidden&quot; name=&quot;id&quot; value=&quot;{{ $u-&gt;id }}&quot; \/&gt;\r\n                            &lt;button class=&quot;friend-button&quot;&gt;\u3068\u3082\u3060\u3061\u7533\u8acb&lt;\/button&gt;\r\n                        &lt;\/form&gt;\r\n                        @else\r\n                        &lt;form action=&quot;{{ route(&#039;request-accept&#039;) }}&quot; method=&quot;post&quot;&gt;\r\n                            @csrf\r\n                            {{ $u-&gt;name}}\r\n                            &lt;span class=&quot;request-received&quot;&gt;\u3068\u3082\u3060\u3061\u7533\u8acb\u3092\u53d7\u3051\u53d6\u308a\u307e\u3057\u305f&lt;\/span&gt;\r\n                            &lt;button class=&quot;friend-button&quot;&gt;\u627f\u8a8d\u3059\u308b&lt;\/button&gt;\r\n                        &lt;\/form&gt;\r\n                        @endif\r\n                        @else\r\n                        {{ $u-&gt;name }}\r\n                        &lt;span class=&quot;wait-accept&quot;&gt;\u3068\u3082\u3060\u3061\u7533\u8acb\u4e2d&lt;\/span&gt;\r\n                        @endif\r\n                        @endif\r\n                    &lt;\/div&gt;\r\n                    @endforeach\r\n                &lt;\/div&gt;\r\n<\/pre>\n<p>\u3068\u3082\u3060\u3061\u7533\u8acb\u304c\u627f\u8a8d\u3055\u308c\u305f\u304b\u3069\u3046\u304b\u306e\u30d5\u30e9\u30b0\u3092 friend_requests \u30c6\u30fc\u30d6\u30eb\u306b\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n&gt; php artisan make:migration add_accept_to_friend_requests --table friend_requests\r\n<\/pre>\n<p>\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u308b\u306e\u3067\u7de8\u96c6\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: php; highlight: [15,25]; title: ; notranslate\" title=\"\">\r\n&lt;?php\r\n\r\nuse Illuminate\\Database\\Migrations\\Migration;\r\nuse Illuminate\\Database\\Schema\\Blueprint;\r\nuse Illuminate\\Support\\Facades\\Schema;\r\n\r\nreturn new class extends Migration\r\n{\r\n    \/**\r\n     * Run the migrations.\r\n     *\/\r\n    public function up(): void\r\n    {\r\n        Schema::table(&#039;friend_requests&#039;, function (Blueprint $table) {\r\n            $table-&gt;boolean(&#039;accepted&#039;)-&gt;after(&#039;recipient&#039;);\r\n        });\r\n    }\r\n\r\n    \/**\r\n     * Reverse the migrations.\r\n     *\/\r\n    public function down(): void\r\n    {\r\n        Schema::table(&#039;friend_requests&#039;, function (Blueprint $table) {\r\n            $table-&gt;dropColumn(&#039;accepted&#039;);\r\n        });\r\n    }\r\n};\r\n<\/pre>\n<p>\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u30d5\u30a1\u30a4\u30eb\u3092\u4fdd\u5b58\u3057\u3066\u3001\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n&gt; php artisan migrate\r\n<\/pre>\n<p>MessageController.php \u3067\u3001\u3068\u3082\u3060\u3061\u627f\u8a8d\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u53d7\u3051\u53d6\u3063\u3066\u3001\u627f\u8a8d\u72b6\u614b\u306b\u5909\u66f4\u3059\u308b\u3002<\/p>\n<pre class=\"brush: php; highlight: [44,45,46,47,48,49,50,51,52]; title: ; notranslate\" title=\"\">\r\n&lt;?php\r\n\r\nnamespace App\\Http\\Controllers;\r\n\r\nuse Illuminate\\Http\\Request;\r\nuse App\\Models\\FriendRequest;\r\nuse App\\Models\\Message;\r\nuse App\\Models\\User;\r\n\r\nclass MessageController extends Controller\r\n{\r\n    public function post(Request $request)\r\n    {\r\n        $msg = $request-&gt;input(&#039;message&#039;);\r\n        \\Log::debug($msg);\r\n        $sender = \\Auth::user()-&gt;id;\r\n        $recipient = $request-&gt;input(&#039;recipient&#039;);\r\n        Message::create(&#x5B;\r\n            &#039;sender&#039; =&gt; $sender,\r\n            &#039;recipient&#039; =&gt; $recipient,\r\n            &#039;text&#039; =&gt; $msg,\r\n        ]);\r\n        return redirect()-&gt;route(&#039;dashboard&#039;);\r\n    }\r\n\r\n    public function users()\r\n    {\r\n        $users = User::orderBy(&#039;created_at&#039;, &#039;desc&#039;)-&gt;get();\r\n        return view(&#039;userlist&#039;, compact(&#039;users&#039;));\r\n    }\r\n\r\n    public function friendRequest(Request $request)\r\n    {\r\n        $sender = \\Auth::user()-&gt;id;\r\n        $recipient = $request-&gt;input(&#039;id&#039;);\r\n        FriendRequest::create(&#x5B;\r\n            &#039;sender&#039; =&gt; $sender,\r\n            &#039;recipient&#039; =&gt; $recipient,\r\n            &#039;accepted&#039; =&gt; false,\r\n        ]);\r\n        return redirect()-&gt;route(&#039;users&#039;);\r\n    }\r\n\r\n    public function acceptRequest(Request $request)\r\n    {\r\n        $sender = $request-&gt;input(&#039;id&#039;);\r\n        $recipient = \\Auth::user()-&gt;id;\r\n        $fr = FriendRequest::where(&#039;sender&#039;, $sender)-&gt;where(&#039;recipient&#039;, $recipient)-&gt;first();\r\n        $fr-&gt;accepted = true;\r\n        $fr-&gt;save();\r\n        return redirect()-&gt;route(&#039;users&#039;);\r\n    }\r\n}\r\n<\/pre>\n<p>User.php \u306b\u3001isFriend()\u3092\u8ffd\u52a0\u3057\u3066\u3001\u627f\u8a8d\u6e08\u307f\u306e\u3068\u3082\u3060\u3061\u304b\u3069\u3046\u304b\u3092\u5224\u5b9a\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b\u3002<\/p>\n<pre class=\"brush: php; highlight: [60,61,62,63,64,65,66,67]; title: ; notranslate\" title=\"\">\r\n&lt;?php\r\n\r\nnamespace App\\Models;\r\n\r\n\/\/ use Illuminate\\Contracts\\Auth\\MustVerifyEmail;\r\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\r\nuse Illuminate\\Foundation\\Auth\\User as Authenticatable;\r\nuse Illuminate\\Notifications\\Notifiable;\r\nuse App\\Models\\FriendRequest;\r\n\r\nclass User extends Authenticatable\r\n{\r\n    \/** @use HasFactory&lt;\\Database\\Factories\\UserFactory&gt; *\/\r\n    use HasFactory, Notifiable;\r\n\r\n    \/**\r\n     * The attributes that are mass assignable.\r\n     *\r\n     * @var array&lt;int, string&gt;\r\n     *\/\r\n    protected $fillable = &#x5B;\r\n        &#039;name&#039;,\r\n        &#039;email&#039;,\r\n        &#039;password&#039;,\r\n    ];\r\n\r\n    \/**\r\n     * The attributes that should be hidden for serialization.\r\n     *\r\n     * @var array&lt;int, string&gt;\r\n     *\/\r\n    protected $hidden = &#x5B;\r\n        &#039;password&#039;,\r\n        &#039;remember_token&#039;,\r\n    ];\r\n\r\n    \/**\r\n     * Get the attributes that should be cast.\r\n     *\r\n     * @return array&lt;string, string&gt;\r\n     *\/\r\n    protected function casts(): array\r\n    {\r\n        return &#x5B;\r\n            &#039;email_verified_at&#039; =&gt; &#039;datetime&#039;,\r\n            &#039;password&#039; =&gt; &#039;hashed&#039;,\r\n        ];\r\n    }\r\n\r\n    public function friendRequest($recipient)\r\n    {\r\n        return FriendRequest::where(&#039;sender&#039;, $this-&gt;id)-&gt;where(&#039;recipient&#039;, $recipient)-&gt;first();\r\n    }\r\n\r\n    public function requestReceived($sender)\r\n    {\r\n        return FriendRequest::where(&#039;sender&#039;, $sender)-&gt;where(&#039;recipient&#039;, $this-&gt;id)-&gt;first();\r\n    }\r\n\r\n    public function isFriend($id)\r\n    {\r\n        $fr = FriendRequest::where(&#039;sender&#039;, $this-&gt;id)-&gt;where(&#039;recipient&#039;, $id)-&gt;first();\r\n        if (!empty($fr) &amp;&amp; $fr-&gt;accepted == true) return true;\r\n        $fr = FriendRequest::where(&#039;sender&#039;, $id)-&gt;where(&#039;recipient&#039;, $this-&gt;id)-&gt;first();\r\n        if (!empty($fr) &amp;&amp; $fr-&gt;accepted == true) return true;\r\n        return false;\r\n    }\r\n}\r\n<\/pre>\n<p>userlist.blade.php \u3067\u3001\u627f\u8a8d\u6e08\u307f\u306e\u3068\u3082\u3060\u3061\u306f\u300c\u3068\u3082\u3060\u3061\u300d\u3068\u8868\u793a\u3059\u308b\u3002<\/p>\n<pre class=\"brush: xml; first-line: 11; highlight: [18,19,20,43]; title: ; notranslate\" title=\"\">\r\n                &lt;div class=&quot;p-6 text-gray-900&quot;&gt;\r\n                    @foreach($users as $u)\r\n                    &lt;div class=&quot;username-div&quot;&gt;\r\n                        @if(\\Auth::user()-&gt;id == $u-&gt;id)\r\n                        {{ $u-&gt;name }}\r\n                        \u3042\u306a\u305f\u3067\u3059\uff01\r\n                        @else\r\n                        @if(\\Auth::user()-&gt;isFriend($u-&gt;id))\r\n                        {{ $u-&gt;name }} \u3068\u3082\u3060\u3061\r\n                        @else\r\n                        @if(empty(\\Auth::user()-&gt;friendRequest($u-&gt;id)))\r\n                        @if(empty(\\Auth::user()-&gt;requestReceived($u-&gt;id)))\r\n                        &lt;form action=&quot;{{ route(&#039;friend-request&#039;) }}&quot; method=&quot;post&quot;&gt;\r\n                            @csrf\r\n                            {{ $u-&gt;name }}\r\n                            &lt;input type=&quot;hidden&quot; name=&quot;id&quot; value=&quot;{{ $u-&gt;id }}&quot; \/&gt;\r\n                            &lt;button class=&quot;friend-button&quot;&gt;\u3068\u3082\u3060\u3061\u7533\u8acb&lt;\/button&gt;\r\n                        &lt;\/form&gt;\r\n                        @else\r\n                        &lt;form action=&quot;{{ route(&#039;request-accept&#039;) }}&quot; method=&quot;post&quot;&gt;\r\n                            @csrf\r\n                            {{ $u-&gt;name}}\r\n                            &lt;input type=&quot;hidden&quot; name=&quot;id&quot; value=&quot;{{ $u-&gt;id }}&quot; \/&gt;\r\n                            &lt;span class=&quot;request-received&quot;&gt;\u3068\u3082\u3060\u3061\u7533\u8acb\u3092\u53d7\u3051\u53d6\u308a\u307e\u3057\u305f&lt;\/span&gt;\r\n                            &lt;button class=&quot;friend-button&quot;&gt;\u627f\u8a8d\u3059\u308b&lt;\/button&gt;\r\n                        &lt;\/form&gt;\r\n                        @endif\r\n                        @else\r\n                        {{ $u-&gt;name }}\r\n                        &lt;span class=&quot;wait-accept&quot;&gt;\u3068\u3082\u3060\u3061\u7533\u8acb\u4e2d&lt;\/span&gt;\r\n                        @endif\r\n                        @endif\r\n                        @endif\r\n                    &lt;\/div&gt;\r\n                    @endforeach\r\n                &lt;\/div&gt;\r\n<\/pre>\n<h4>\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u8868\u793a\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b<\/h4>\n<p>\u307e\u305a\u306f\u30c0\u30c3\u30b7\u30e5\u30dc\u30fc\u30c9\u306b\u81ea\u5206\u3042\u3066\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u8868\u793a\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<p>web.php \u306e\u30c0\u30c3\u30b7\u30e5\u30dc\u30fc\u30c9\u3092\u8868\u793a\u3059\u308b\u90e8\u5206\u3092\u3001MessageController\u7d4c\u7531\u3067\u52d5\u4f5c\u3059\u308b\u3088\u3046\u306b\u4fee\u6b63\u3057\u307e\u3059\u3002<\/p>\n<p>\u3082\u3068\u304b\u3089\u5b9a\u7fa9\u3057\u3066\u3044\u305f\u4ee5\u4e0b\u306e\u90e8\u5206\u306f\u524a\u9664\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\nRoute::get(&#039;\/dashboard&#039;, function () {\r\n    return view(&#039;dashboard&#039;);\r\n})-&gt;middleware(&#x5B;&#039;auth&#039;, &#039;verified&#039;])-&gt;name(&#039;dashboard&#039;);\r\n<\/pre>\n<p>\u304b\u308f\u308a\u306b\u4ee5\u4e0b\u306e\u8a18\u8ff0\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: php; first-line: 11; title: ; notranslate\" title=\"\">\r\nRoute::get(&#039;\/dashboard&#039;, &#x5B;MessageController::class, &#039;dashboard&#039;])-&gt;name(&#039;dashboard&#039;);\r\n<\/pre>\n<p>MessageController.php\u306b dashboard()\u30e1\u30bd\u30c3\u30c9\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: php; highlight: [12,13,14,15,16,17,18,19,20]; title: ; notranslate\" title=\"\">\r\n&lt;?php\r\n\r\nnamespace App\\Http\\Controllers;\r\n\r\nuse Illuminate\\Http\\Request;\r\nuse App\\Models\\FriendRequest;\r\nuse App\\Models\\Message;\r\nuse App\\Models\\User;\r\n\r\nclass MessageController extends Controller\r\n{\r\n    public function dashboard()\r\n    {\r\n        $id = \\Auth::user()-&gt;id;\r\n        $messages = Message::where(&#039;sender&#039;, $id)\r\n        -&gt;where(&#039;recipient&#039;, $id)\r\n        -&gt;orderBy(&#039;created_at&#039;, &#039;desc&#039;)\r\n        -&gt;get();\r\n        return view(&#039;dashboard&#039;, compact(&#039;messages&#039;));\r\n    }\r\n\r\n    public function post(Request $request)\r\n    {\r\n        $msg = $request-&gt;input(&#039;message&#039;);\r\n        \\Log::debug($msg);\r\n        $sender = \\Auth::user()-&gt;id;\r\n        $recipient = $request-&gt;input(&#039;recipient&#039;);\r\n        Message::create(&#x5B;\r\n            &#039;sender&#039; =&gt; $sender,\r\n            &#039;recipient&#039; =&gt; $recipient,\r\n            &#039;text&#039; =&gt; $msg,\r\n        ]);\r\n        return redirect()-&gt;route(&#039;dashboard&#039;);\r\n    }\r\n\r\n(\u4ee5\u4e0b\u7565)\r\n<\/pre>\n<p>dashboard.blade.php \u306b\u3001\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u8868\u793a\u3059\u308b\u51e6\u7406\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: xml; first-line: 8; highlight: [11,12,13,14,15,16,17,18,19,20]; title: ; notranslate\" title=\"\">\r\n    &lt;div class=&quot;py-12&quot;&gt;\r\n        &lt;div class=&quot;max-w-7xl mx-auto sm:px-6 lg:px-8&quot;&gt;\r\n            &lt;div class=&quot;bg-white overflow-hidden shadow-sm sm:rounded-lg&quot;&gt;\r\n                &lt;div class=&quot;p-6 text-gray-900&quot;&gt;\r\n                    @foreach($messages as $m)\r\n                    &lt;div&gt;\r\n                        {!! nl2br($m-&gt;text) !!}\r\n                    &lt;\/div&gt;\r\n                    &lt;div&gt;\r\n                        {{ $m-&gt;created_at }}\r\n                    &lt;\/div&gt;\r\n                    @endforeach\r\n                &lt;\/div&gt;\r\n                &lt;div class=&quot;p-6 text-gray-900&quot;&gt;\r\n                    &lt;form action=&quot;{{ route(&#039;post&#039;) }}&quot; method=&quot;post&quot;&gt;\r\n                        @csrf\r\n                        &lt;input type=&quot;hidden&quot; name=&quot;recipient&quot; value=&quot;{{ \\Auth::user()-&gt;id }}&quot; \/&gt;\r\n                        &lt;textarea name=&quot;message&quot; required&gt;&lt;\/textarea&gt;\r\n                        &lt;br \/&gt;\r\n                        &lt;button&gt;\u9001\u4fe1\u3059\u308b&lt;\/button&gt;\r\n                    &lt;\/form&gt;\r\n                &lt;\/div&gt;\r\n                &lt;div&gt;\r\n                    &lt;a href=&quot;{{ route(&#039;users&#039;) }}&quot;&gt;\u30e6\u30fc\u30b6\u30fc\u4e00\u89a7&lt;\/a&gt;\r\n                &lt;\/div&gt;\r\n            &lt;\/div&gt;\r\n        &lt;\/div&gt;\r\n    &lt;\/div&gt;\r\n<\/pre>\n<h4>\u3068\u3082\u3060\u3061\u3068\u306e\u30c8\u30fc\u30af\u753b\u9762\u3092\u4f5c\u308b<\/h4>\n<p>\u30c0\u30c3\u30b7\u30e5\u30dc\u30fc\u30c9\u3067\u306f\u81ea\u5206\u3042\u3066\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u8868\u793a\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>\u6b21\u306f\u3068\u3082\u3060\u3061\u3068\u306e\u30c8\u30fc\u30af\u753b\u9762\u3092\u4f5c\u3063\u3066\u3001\u3068\u3082\u3060\u3061\u3068\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u3084\u308a\u3068\u308a\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u304b\u3089\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: php; highlight: [16]; title: ; notranslate\" title=\"\">\r\n&lt;?php\r\n\r\nuse App\\Http\\Controllers\\MessageController;\r\nuse App\\Http\\Controllers\\ProfileController;\r\nuse Illuminate\\Support\\Facades\\Route;\r\n\r\nRoute::get(&#039;\/&#039;, function () {\r\n    return view(&#039;welcome&#039;);\r\n});\r\n\r\nRoute::get(&#039;\/dashboard&#039;, &#x5B;MessageController::class, &#039;dashboard&#039;])-&gt;name(&#039;dashboard&#039;);\r\nRoute::post(&#039;\/post&#039;, &#x5B;MessageController::class, &#039;post&#039;])-&gt;name(&#039;post&#039;);\r\nRoute::get(&#039;\/users&#039;, &#x5B;MessageController::class, &#039;users&#039;])-&gt;name(&#039;users&#039;);\r\nRoute::post(&#039;\/friend-request&#039;, &#x5B;MessageController::class, &#039;friendRequest&#039;])-&gt;name(&#039;friend-request&#039;);\r\nRoute::post(&#039;\/request-accept&#039;, &#x5B;MessageController::class, &#039;acceptRequest&#039;])-&gt;name(&#039;request-accept&#039;);\r\nRoute::get(&#039;\/talk\/{id}&#039;, &#x5B;MessageController::class, &#039;talk&#039;])-&gt;name(&#039;talk&#039;);\r\n\r\nRoute::middleware(&#039;auth&#039;)-&gt;group(function () {\r\n    Route::get(&#039;\/profile&#039;, &#x5B;ProfileController::class, &#039;edit&#039;])-&gt;name(&#039;profile.edit&#039;);\r\n    Route::patch(&#039;\/profile&#039;, &#x5B;ProfileController::class, &#039;update&#039;])-&gt;name(&#039;profile.update&#039;);\r\n    Route::delete(&#039;\/profile&#039;, &#x5B;ProfileController::class, &#039;destroy&#039;])-&gt;name(&#039;profile.destroy&#039;);\r\n});\r\n\r\nrequire __DIR__.&#039;\/auth.php&#039;;\r\n<\/pre>\n<p>\u6b21\u306b userlist.blade.php \u306e\u540d\u524d\u306e\u90e8\u5206\u3092\u30ea\u30f3\u30af\u306b\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: xml; first-line: 11; highlight: [19]; title: ; notranslate\" title=\"\">\r\n                &lt;div class=&quot;p-6 text-gray-900&quot;&gt;\r\n                    @foreach($users as $u)\r\n                    &lt;div class=&quot;username-div&quot;&gt;\r\n                        @if(\\Auth::user()-&gt;id == $u-&gt;id)\r\n                        {{ $u-&gt;name }}\r\n                        \u3042\u306a\u305f\u3067\u3059\uff01\r\n                        @else\r\n                        @if(\\Auth::user()-&gt;isFriend($u-&gt;id))\r\n                        &lt;a href=&quot;{{ route(&#039;talk&#039;, $u-&gt;id) }}&quot;&gt;{{ $u-&gt;name }}&lt;\/a&gt; \u3068\u3082\u3060\u3061\r\n                        @else\r\n                        @if(empty(\\Auth::user()-&gt;friendRequest($u-&gt;id)))\r\n                        @if(empty(\\Auth::user()-&gt;requestReceived($u-&gt;id)))\r\n                        &lt;form action=&quot;{{ route(&#039;friend-request&#039;) }}&quot; method=&quot;post&quot;&gt;\r\n                            @csrf\r\n                            {{ $u-&gt;name }}\r\n                            &lt;input type=&quot;hidden&quot; name=&quot;id&quot; value=&quot;{{ $u-&gt;id }}&quot; \/&gt;\r\n                            &lt;button class=&quot;friend-button&quot;&gt;\u3068\u3082\u3060\u3061\u7533\u8acb&lt;\/button&gt;\r\n                        &lt;\/form&gt;\r\n                        @else\r\n<\/pre>\n<p>MessageController.php\u306btalk()\u30e1\u30bd\u30c3\u30c9\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: php; highlight: [64,65,66,67]; title: ; notranslate\" title=\"\">\r\n&lt;?php\r\n\r\nnamespace App\\Http\\Controllers;\r\n\r\nuse Illuminate\\Http\\Request;\r\nuse App\\Models\\FriendRequest;\r\nuse App\\Models\\Message;\r\nuse App\\Models\\User;\r\n\r\nclass MessageController extends Controller\r\n{\r\n    public function dashboard()\r\n    {\r\n        $id = \\Auth::user()-&gt;id;\r\n        $messages = Message::where(&#039;sender&#039;, $id)\r\n        -&gt;where(&#039;recipient&#039;, $id)\r\n        -&gt;orderBy(&#039;created_at&#039;, &#039;desc&#039;)\r\n        -&gt;get();\r\n        return view(&#039;dashboard&#039;, compact(&#039;messages&#039;));\r\n    }\r\n\r\n    public function post(Request $request)\r\n    {\r\n        $msg = $request-&gt;input(&#039;message&#039;);\r\n        \\Log::debug($msg);\r\n        $sender = \\Auth::user()-&gt;id;\r\n        $recipient = $request-&gt;input(&#039;recipient&#039;);\r\n        Message::create(&#x5B;\r\n            &#039;sender&#039; =&gt; $sender,\r\n            &#039;recipient&#039; =&gt; $recipient,\r\n            &#039;text&#039; =&gt; $msg,\r\n        ]);\r\n        return redirect()-&gt;route(&#039;dashboard&#039;);\r\n    }\r\n\r\n    public function users()\r\n    {\r\n        $users = User::orderBy(&#039;created_at&#039;, &#039;desc&#039;)-&gt;get();\r\n        return view(&#039;userlist&#039;, compact(&#039;users&#039;));\r\n    }\r\n\r\n    public function friendRequest(Request $request)\r\n    {\r\n        $sender = \\Auth::user()-&gt;id;\r\n        $recipient = $request-&gt;input(&#039;id&#039;);\r\n        FriendRequest::create(&#x5B;\r\n            &#039;sender&#039; =&gt; $sender,\r\n            &#039;recipient&#039; =&gt; $recipient,\r\n            &#039;accepted&#039; =&gt; false,\r\n        ]);\r\n        return redirect()-&gt;route(&#039;users&#039;);\r\n    }\r\n\r\n    public function acceptRequest(Request $request)\r\n    {\r\n        $sender = $request-&gt;input(&#039;id&#039;);\r\n        $recipient = \\Auth::user()-&gt;id;\r\n        $fr = FriendRequest::where(&#039;sender&#039;, $sender)-&gt;where(&#039;recipient&#039;, $recipient)-&gt;first();\r\n        $fr-&gt;accepted = true;\r\n        $fr-&gt;save();\r\n        return redirect()-&gt;route(&#039;users&#039;);\r\n    }\r\n\r\n    public function talk($id)\r\n    {\r\n        return view(&#039;talk&#039;);\r\n    }\r\n}\r\n<\/pre>\n<p>talk.blade.php \u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n&gt; php artisan make:view talk\r\n<\/pre>\n<p>talk.blade.php \u3092\u4f5c\u6210\u3059\u308b\u3068\u3001\u30a8\u30e9\u30fc\u3092\u8868\u793a\u3057\u306a\u3044\u3067\u30c8\u30fc\u30af\u753b\u9762\u3092\u8868\u793a\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>\u30c8\u30fc\u30af\u753b\u9762\u3092\u3001layout\/app.blade.php \u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u5229\u7528\u3059\u308b\u3088\u3046\u306b\u4fee\u6b63\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n&lt;x-app-layout&gt;\r\n    &lt;x-slot name=&quot;header&quot;&gt;\r\n        &lt;h2 class=&quot;font-semibold text-xl text-gray-800 leading-tight&quot;&gt;\r\n            {{ __(&#039;\u30c8\u30fc\u30af&#039;) }}\r\n        &lt;\/h2&gt;\r\n    &lt;\/x-slot&gt;\r\n\r\n    &lt;div class=&quot;py-12&quot;&gt;\r\n        &lt;div class=&quot;max-w-7xl mx-auto sm:px-6 lg:px-8&quot;&gt;\r\n            &lt;div class=&quot;bg-white overflow-hidden shadow-sm sm:rounded-lg&quot;&gt;\r\n                &lt;div&gt;\r\n                    &lt;a href=&quot;{{ route(&#039;users&#039;) }}&quot;&gt;\u30e6\u30fc\u30b6\u30fc\u4e00\u89a7&lt;\/a&gt;\r\n                &lt;\/div&gt;\r\n            &lt;\/div&gt;\r\n        &lt;\/div&gt;\r\n    &lt;\/div&gt;\r\n&lt;\/x-app-layout&gt;\r\n<\/pre>\n<p>\u30c8\u30fc\u30af\u76f8\u624b\u306e\u540d\u524d\u3092\u30c8\u30fc\u30af\u753b\u9762\u306b\u8868\u793a\u3057\u307e\u3059\u3002<\/p>\n<p>\u305d\u306e\u305f\u3081\u306b\u3001MessageController.php \u306e talk() \u30e1\u30bd\u30c3\u30c9\u3067\u3001\u30c8\u30fc\u30af\u306e\u76f8\u624b\u306e\u60c5\u5831\u3092\u53d6\u5f97\u3057\u3066\u3001talk.blade.php \u306b\u6e21\u3059\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: php; first-line: 64; highlight: [65,66,67]; title: ; notranslate\" title=\"\">\r\n\r\n    {\r\n        $me = \\Auth::user();\r\n        $partner = User::find($id);\r\n        return view(&#039;talk&#039;, compact(&#039;me&#039;, &#039;partner&#039;));\r\n    }\r\n<\/pre>\n<p>\u5909\u6570 partner \u306b\u30c8\u30fc\u30af\u76f8\u624b\u306e User \u304c\u6e21\u3055\u308c\u308b\u306e\u3067\u3001\u3053\u308c\u3092\u3082\u3068\u306b\u30c8\u30fc\u30af\u76f8\u624b\u306e\u540d\u524d\u3092\u8868\u793a\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: xml; first-line: 8; highlight: [11,12,13]; title: ; notranslate\" title=\"\">\r\n    &lt;div class=&quot;py-12&quot;&gt;\r\n        &lt;div class=&quot;max-w-7xl mx-auto sm:px-6 lg:px-8&quot;&gt;\r\n            &lt;div class=&quot;bg-white overflow-hidden shadow-sm sm:rounded-lg&quot;&gt;\r\n                &lt;div&gt;\r\n                    {{ $partner-&gt;name }}\u3055\u3093\u3068\u306e\u30c8\u30fc\u30af\r\n                &lt;\/div&gt;\r\n                &lt;div&gt;\r\n                    &lt;a href=&quot;{{ route(&#039;users&#039;) }}&quot;&gt;\u30e6\u30fc\u30b6\u30fc\u4e00\u89a7&lt;\/a&gt;\r\n                &lt;\/div&gt;\r\n            &lt;\/div&gt;\r\n        &lt;\/div&gt;\r\n    &lt;\/div&gt;\r\n<\/pre>\n<p>\u30c8\u30fc\u30af\u753b\u9762\u306b\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u9001\u4fe1\u3059\u308b\u305f\u3081\u306e\u30d5\u30a9\u30fc\u30e0\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<p>dashboard.blade.php \u306b\u3042\u308b\u3082\u306e\u3092\u30b3\u30d4\u30fc\u3057\u3066\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"brush: xml; first-line: 8; highlight: [14,15,16,17,18,19,20,21,22]; title: ; notranslate\" title=\"\">\r\n    &lt;div class=&quot;py-12&quot;&gt;\r\n        &lt;div class=&quot;max-w-7xl mx-auto sm:px-6 lg:px-8&quot;&gt;\r\n            &lt;div class=&quot;bg-white overflow-hidden shadow-sm sm:rounded-lg&quot;&gt;\r\n                &lt;div&gt;\r\n                    {{ $partner-&gt;name }}\u3055\u3093\u3068\u306e\u30c8\u30fc\u30af\r\n                &lt;\/div&gt;\r\n                &lt;div class=&quot;p-6 text-gray-900&quot;&gt;\r\n                    &lt;form action=&quot;{{ route(&#039;post&#039;) }}&quot; method=&quot;post&quot;&gt;\r\n                        @csrf\r\n                        &lt;input type=&quot;hidden&quot; name=&quot;recipient&quot; value=&quot;{{ $partner-&gt;id }}&quot; \/&gt;\r\n                        &lt;textarea name=&quot;message&quot; required&gt;&lt;\/textarea&gt;\r\n                        &lt;br \/&gt;\r\n                        &lt;button&gt;\u9001\u4fe1\u3059\u308b&lt;\/button&gt;\r\n                    &lt;\/form&gt;\r\n                &lt;\/div&gt;\r\n                &lt;div&gt;\r\n                    &lt;a href=&quot;{{ route(&#039;users&#039;) }}&quot;&gt;\u30e6\u30fc\u30b6\u30fc\u4e00\u89a7&lt;\/a&gt;\r\n                &lt;\/div&gt;\r\n            &lt;\/div&gt;\r\n        &lt;\/div&gt;\r\n    &lt;\/div&gt;\r\n<\/pre>\n<p>\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u9001\u4fe1\u3059\u308b\u3068\u3001\u30c0\u30c3\u30b7\u30e5\u30dc\u30fc\u30c9\u753b\u9762\u306b\u9077\u79fb\u3057\u3066\u3057\u307e\u3044\u307e\u3057\u305f\u3002<\/p>\n<p>\u3053\u308c\u306f MessageController.php \u306e post() \u30e1\u30bd\u30c3\u30c9\u304c\u56fa\u5b9a\u7684\u306b\u30c0\u30c3\u30b7\u30e5\u30dc\u30fc\u30c9\u306b\u9077\u79fb\u3055\u305b\u3066\u3044\u308b\u305f\u3081\u3067\u3059\u3002<\/p>\n<p>\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u9001\u4fe1\u8005\u3068\u53d7\u4fe1\u8005\u304c\u540c\u4e00\u306e\u5834\u5408\u306f\u30c0\u30c3\u30b7\u30e5\u30dc\u30fc\u30c9\u306b\u9077\u79fb\u3057\u3001\u305d\u308c\u4ee5\u5916\u306f\u30c8\u30fc\u30af\u753b\u9762\u306b\u9077\u79fb\u3059\u308b\u3088\u3046\u306b\u4fee\u6b63\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: php; first-line: 22; title: ; notranslate\" title=\"\">\r\n    public function post(Request $request)\r\n    {\r\n        $msg = $request-&gt;input(&#039;message&#039;);\r\n        $sender = \\Auth::user()-&gt;id;\r\n        $recipient = $request-&gt;input(&#039;recipient&#039;);\r\n        Message::create(&#x5B;\r\n            &#039;sender&#039; =&gt; $sender,\r\n            &#039;recipient&#039; =&gt; $recipient,\r\n            &#039;text&#039; =&gt; $msg,\r\n        ]);\r\n        if ($sender == $recipient) {\r\n            return redirect()-&gt;route(&#039;dashboard&#039;);\r\n        }\r\n        return redirect()-&gt;route(&#039;talk&#039;, $recipient);\r\n    }\r\n<\/pre>\n<p>\u30c8\u30fc\u30af\u753b\u9762\u306b\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u8868\u793a\u3057\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u3082\u30c0\u30c3\u30b7\u30e5\u30dc\u30fc\u30c9\u306b\u3042\u3063\u305f\u3082\u306e\u3092\u30b3\u30d4\u30fc\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"brush: xml; first-line: 8; highlight: [14,15,16,17,18,19,20,21,22,23,24,25]; title: ; notranslate\" title=\"\">\r\n    &lt;div class=&quot;py-12&quot;&gt;\r\n        &lt;div class=&quot;max-w-7xl mx-auto sm:px-6 lg:px-8&quot;&gt;\r\n            &lt;div class=&quot;bg-white overflow-hidden shadow-sm sm:rounded-lg&quot;&gt;\r\n                &lt;div&gt;\r\n                    {{ $partner-&gt;name }}\u3055\u3093\u3068\u306e\u30c8\u30fc\u30af\r\n                &lt;\/div&gt;\r\n                &lt;div class=&quot;p-6 text-gray-900&quot;&gt;\r\n                    @foreach($messages as $m)\r\n                    &lt;div class=&quot;border&quot;&gt;\r\n                        &lt;div&gt;\r\n                            {!! nl2br($m-&gt;text) !!}\r\n                        &lt;\/div&gt;\r\n                        &lt;div&gt;\r\n                            {{ $m-&gt;created_at }}\r\n                        &lt;\/div&gt;\r\n                    &lt;\/div&gt;\r\n                    @endforeach\r\n                &lt;\/div&gt;\r\n                &lt;div class=&quot;p-6 text-gray-900&quot;&gt;\r\n                    &lt;form action=&quot;{{ route(&#039;post&#039;) }}&quot; method=&quot;post&quot;&gt;\r\n                        @csrf\r\n                        &lt;input type=&quot;hidden&quot; name=&quot;recipient&quot; value=&quot;{{ $partner-&gt;id }}&quot; \/&gt;\r\n                        &lt;textarea name=&quot;message&quot; required&gt;&lt;\/textarea&gt;\r\n                        &lt;br \/&gt;\r\n                        &lt;button&gt;\u9001\u4fe1\u3059\u308b&lt;\/button&gt;\r\n                    &lt;\/form&gt;\r\n                &lt;\/div&gt;\r\n                &lt;div&gt;\r\n                    &lt;a href=&quot;{{ route(&#039;users&#039;) }}&quot;&gt;\u30e6\u30fc\u30b6\u30fc\u4e00\u89a7&lt;\/a&gt;\r\n                &lt;\/div&gt;\r\n            &lt;\/div&gt;\r\n        &lt;\/div&gt;\r\n    &lt;\/div&gt;\r\n<\/pre>\n<p>MessageController.php \u304b\u3089\u9001\u53d7\u4fe1\u3057\u305f\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u4e00\u89a7\u3092 talk.blade.php \u306b\u6e21\u3057\u307e\u3059\u3002<\/p>\n<p>\u81ea\u5206\u304c\u30c8\u30fc\u30af\u76f8\u624b\u306b\u9001\u4fe1\u3057\u305f\u30e1\u30c3\u30bb\u30fc\u30b8\u3068\u3001\u30c8\u30fc\u30af\u76f8\u624b\u304c\u81ea\u5206\u5b9b\u306b\u9001\u4fe1\u3057\u305f\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u691c\u7d22\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u306e\u3067\u3001\u3061\u3087\u3063\u3068\u8907\u96d1\u306a\u30af\u30a8\u30ea\u3092\u5b9f\u884c\u3059\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"brush: php; first-line: 66; highlight: [70,71,72,73,74,75,76,77]; title: ; notranslate\" title=\"\">\r\n    public function talk($id)\r\n    {\r\n        $me = \\Auth::user();\r\n        $partner = User::find($id);\r\n        $messages = Message::where(function($query) use($me, $partner) {\r\n            $query-&gt;where(&#039;sender&#039;, $partner-&gt;id)\r\n            -&gt;where(&#039;recipient&#039;, $me-&gt;id);\r\n        })-&gt;orWhere(function($query) use($me, $partner) {\r\n            $query-&gt;where(&#039;sender&#039;, $me-&gt;id)\r\n            -&gt;where(&#039;recipient&#039;, $partner-&gt;id);\r\n        })-&gt;get();\r\n        return view(&#039;talk&#039;, compact(&#039;me&#039;, &#039;partner&#039;, &#039;messages&#039;));\r\n    }\r\n<\/pre>\n<p>\u3053\u308c\u3067\u30c8\u30fc\u30af\u753b\u9762\u306b\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n<p>\u3057\u304b\u3057\u3001\u81ea\u5206\u304c\u9001\u4fe1\u3057\u305f\u30e1\u30c3\u30bb\u30fc\u30b8\u306a\u306e\u304b\u76f8\u624b\u304b\u3089\u9001\u3089\u308c\u305f\u30e1\u30c3\u30bb\u30fc\u30b8\u306a\u306e\u304b\u533a\u5225\u304c\u3064\u304d\u307e\u305b\u3093\u3002<\/p>\n<p>\u81ea\u5206\u304c\u9001\u4fe1\u3057\u305f\u30e1\u30c3\u30bb\u30fc\u30b8\u3092CSS\u3067\u53f3\u5bc4\u305b\u306b\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>@if\uff5e@endif \u3092\u4f7f\u7528\u3057\u3066\u3001\u81ea\u5206\u304c\u9001\u4fe1\u3057\u305f\u30e1\u30c3\u30bb\u30fc\u30b8\u306b\u53f3\u5bc4\u305b\u306e\u30af\u30e9\u30b9 text-right \u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: xml; first-line: 8; highlight: [16]; title: ; notranslate\" title=\"\">\r\n    &lt;div class=&quot;py-12&quot;&gt;\r\n        &lt;div class=&quot;max-w-7xl mx-auto sm:px-6 lg:px-8&quot;&gt;\r\n            &lt;div class=&quot;bg-white overflow-hidden shadow-sm sm:rounded-lg&quot;&gt;\r\n                &lt;div&gt;\r\n                    {{ $partner-&gt;name }}\u3055\u3093\u3068\u306e\u30c8\u30fc\u30af\r\n                &lt;\/div&gt;\r\n                &lt;div class=&quot;p-6 text-gray-900&quot;&gt;\r\n                    @foreach($messages as $m)\r\n                    &lt;div class=&quot;border @if($m-&gt;sender == \\Auth::user()-&gt;id)text-right @endif&quot;&gt;\r\n                        &lt;div&gt;\r\n                            {!! nl2br($m-&gt;text) !!}\r\n                        &lt;\/div&gt;\r\n                        &lt;div&gt;\r\n                            {{ $m-&gt;created_at }}\r\n                        &lt;\/div&gt;\r\n                    &lt;\/div&gt;\r\n                    @endforeach\r\n                &lt;\/div&gt;\r\n                &lt;div class=&quot;p-6 text-gray-900&quot;&gt;\r\n                    &lt;form action=&quot;{{ route(&#039;post&#039;) }}&quot; method=&quot;post&quot;&gt;\r\n                        @csrf\r\n                        &lt;input type=&quot;hidden&quot; name=&quot;recipient&quot; value=&quot;{{ $partner-&gt;id }}&quot; \/&gt;\r\n                        &lt;textarea name=&quot;message&quot; required&gt;&lt;\/textarea&gt;\r\n                        &lt;br \/&gt;\r\n                        &lt;button&gt;\u9001\u4fe1\u3059\u308b&lt;\/button&gt;\r\n                    &lt;\/form&gt;\r\n                &lt;\/div&gt;\r\n                &lt;div&gt;\r\n                    &lt;a href=&quot;{{ route(&#039;users&#039;) }}&quot;&gt;\u30e6\u30fc\u30b6\u30fc\u4e00\u89a7&lt;\/a&gt;\r\n                &lt;\/div&gt;\r\n            &lt;\/div&gt;\r\n        &lt;\/div&gt;\r\n    &lt;\/div&gt;\r\n<\/pre>\n<p>LINE\u306e\u898b\u305f\u76ee\u306b\u5c11\u3057\u8fd1\u3065\u3051\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u5185\u5bb9\u3092CSS\u3067\u8abf\u6574\u3057\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u30e1\u30c3\u30bb\u30fc\u30b8\u3084\u65e5\u6642\u3092\u30dc\u30fc\u30c0\u30fc\u304b\u3089\u5c11\u3057\u96e2\u3059<\/li>\n<li>\u65e5\u6642\u306e\u30d5\u30a9\u30f3\u30c8\u30b5\u30a4\u30ba\u3092\u5c0f\u3055\u304f\u3059\u308b<\/li>\n<li>\u81ea\u5206\u304c\u9001\u4fe1\u3057\u305f\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u80cc\u666f\u8272\u3092\u7dd1\u306b\u3059\u308b<\/li>\n<\/ul>\n<p>layout\/app.blade.php \u306b\u30af\u30e9\u30b9\u3092\u5b9a\u7fa9\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: xml; highlight: [28,29,30,31,32,33,34,35,36,37,38,39]; title: ; notranslate\" title=\"\">\r\n&lt;!DOCTYPE html&gt;\r\n&lt;html lang=&quot;{{ str_replace(&#039;_&#039;, &#039;-&#039;, app()-&gt;getLocale()) }}&quot;&gt;\r\n    &lt;head&gt;\r\n        &lt;meta charset=&quot;utf-8&quot;&gt;\r\n        &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1&quot;&gt;\r\n        &lt;meta name=&quot;csrf-token&quot; content=&quot;{{ csrf_token() }}&quot;&gt;\r\n\r\n        &lt;title&gt;{{ config(&#039;app.name&#039;, &#039;Laravel&#039;) }}&lt;\/title&gt;\r\n\r\n        &lt;!-- Fonts --&gt;\r\n        &lt;link rel=&quot;preconnect&quot; href=&quot;https:\/\/fonts.bunny.net&quot;&gt;\r\n        &lt;link href=&quot;https:\/\/fonts.bunny.net\/css?family=figtree:400,500,600&amp;display=swap&quot; rel=&quot;stylesheet&quot; \/&gt;\r\n        &lt;style&gt;\r\n        .username-div {\r\n            margin: 2px;\r\n        }\r\n        .friend-button {\r\n            font-size: small;\r\n            background-color: #b9f9f3;\r\n            border-radius: 5px;\r\n            padding: 3px 5px;\r\n        }\r\n        .border {\r\n            border: 1px solid gray;\r\n            border-radius: 5px;\r\n            margin-bottom: 2px;\r\n        }\r\n        .text-right {\r\n            text-align: right;\r\n        }\r\n        .pd5 {\r\n            padding: 5px;\r\n        }\r\n        .text-xs {\r\n            font-size: x-small;\r\n        }\r\n        .bg-green {\r\n            background-color: #80ff80;\r\n        }\r\n        &lt;\/style&gt;\r\n        &lt;!-- Scripts --&gt;\r\n        @vite(&#x5B;&#039;resources\/css\/app.css&#039;, &#039;resources\/js\/app.js&#039;])\r\n    &lt;\/head&gt;\r\n    &lt;body class=&quot;font-sans antialiased&quot;&gt;\r\n        &lt;div class=&quot;min-h-screen bg-gray-100&quot;&gt;\r\n            @include(&#039;layouts.navigation&#039;)\r\n\r\n            &lt;!-- Page Heading --&gt;\r\n            @isset($header)\r\n                &lt;header class=&quot;bg-white shadow&quot;&gt;\r\n                    &lt;div class=&quot;max-w-7xl mx-auto py-6 px-4 sm:px-6 lg:px-8&quot;&gt;\r\n                        {{ $header }}\r\n                    &lt;\/div&gt;\r\n                &lt;\/header&gt;\r\n            @endisset\r\n\r\n            &lt;!-- Page Content --&gt;\r\n            &lt;main&gt;\r\n                {{ $slot }}\r\n            &lt;\/main&gt;\r\n        &lt;\/div&gt;\r\n    &lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p>talk.blade.php \u306b\u3001app.blade.php \u3067\u8ffd\u52a0\u3057\u305f\u30af\u30e9\u30b9\u3092\u53cd\u6620\u3055\u305b\u307e\u3059\u3002<\/p>\n<pre class=\"brush: xml; first-line: 8; highlight: [16,20]; title: ; notranslate\" title=\"\">\r\n    &lt;div class=&quot;py-12&quot;&gt;\r\n        &lt;div class=&quot;max-w-7xl mx-auto sm:px-6 lg:px-8&quot;&gt;\r\n            &lt;div class=&quot;bg-white overflow-hidden shadow-sm sm:rounded-lg&quot;&gt;\r\n                &lt;div&gt;\r\n                    {{ $partner-&gt;name }}\u3055\u3093\u3068\u306e\u30c8\u30fc\u30af\r\n                &lt;\/div&gt;\r\n                &lt;div class=&quot;p-6 text-gray-900&quot;&gt;\r\n                    @foreach($messages as $m)\r\n                    &lt;div class=&quot;border pd5 @if($m-&gt;sender == \\Auth::user()-&gt;id)text-right bg-green @endif&quot;&gt;\r\n                        &lt;div&gt;\r\n                            {!! nl2br($m-&gt;text) !!}\r\n                        &lt;\/div&gt;\r\n                        &lt;div class=&quot;text-xs&quot;&gt;\r\n                            {{ $m-&gt;created_at }}\r\n                        &lt;\/div&gt;\r\n                    &lt;\/div&gt;\r\n                    @endforeach\r\n                &lt;\/div&gt;\r\n                &lt;div class=&quot;p-6 text-gray-900&quot;&gt;\r\n                    &lt;form action=&quot;{{ route(&#039;post&#039;) }}&quot; method=&quot;post&quot;&gt;\r\n                        @csrf\r\n                        &lt;input type=&quot;hidden&quot; name=&quot;recipient&quot; value=&quot;{{ $partner-&gt;id }}&quot; \/&gt;\r\n                        &lt;textarea name=&quot;message&quot; required&gt;&lt;\/textarea&gt;\r\n                        &lt;br \/&gt;\r\n                        &lt;button&gt;\u9001\u4fe1\u3059\u308b&lt;\/button&gt;\r\n                    &lt;\/form&gt;\r\n                &lt;\/div&gt;\r\n                &lt;div&gt;\r\n                    &lt;a href=&quot;{{ route(&#039;users&#039;) }}&quot;&gt;\u30e6\u30fc\u30b6\u30fc\u4e00\u89a7&lt;\/a&gt;\r\n                &lt;\/div&gt;\r\n            &lt;\/div&gt;\r\n        &lt;\/div&gt;\r\n    &lt;\/div&gt;\r\n<\/pre>\n<h4>\u753b\u50cf\u3092\u9001\u4fe1\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b<\/h4>\n<p>\u30c8\u30fc\u30af\u753b\u9762\u3067\u306f\u6587\u5b57\u3060\u3051\u3067\u306a\u304f\u753b\u50cf\u3092\u9001\u4fe1\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u305f\u65b9\u304c\u30b3\u30df\u30e5\u30cb\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u697d\u3057\u3081\u308b\u3067\u3057\u3087\u3046\u3002<\/p>\n<p>\u30c8\u30fc\u30af\u753b\u9762\u3067\u753b\u50cf\u3092\u9001\u4fe1\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u307e\u305a\u306f\u30c8\u30fc\u30af\u753b\u9762\u306e\u30d3\u30e5\u30fc\u3067\u3042\u308b talk.blade.php \u3067\u753b\u50cf\u3092\u9001\u4fe1\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: xml; first-line: 26; highlight: [27,32,33]; title: ; notranslate\" title=\"\">\r\n                &lt;div class=&quot;p-6 text-gray-900&quot;&gt;\r\n                    &lt;form action=&quot;{{ route(&#039;post&#039;) }}&quot; method=&quot;post&quot; enctype=&quot;multipart\/form-data&quot;&gt;\r\n                        @csrf\r\n                        &lt;input type=&quot;hidden&quot; name=&quot;recipient&quot; value=&quot;{{ $partner-&gt;id }}&quot; \/&gt;\r\n                        &lt;textarea name=&quot;message&quot; required&gt;&lt;\/textarea&gt;\r\n                        &lt;br \/&gt;\r\n                        &lt;input type=&quot;file&quot; name=&quot;image&quot;&gt;\r\n                        &lt;br \/&gt;\r\n                        &lt;button&gt;\u9001\u4fe1\u3059\u308b&lt;\/button&gt;\r\n                    &lt;\/form&gt;\r\n                &lt;\/div&gt;\r\n<\/pre>\n<p>MessageController.php \u3067\u9001\u4fe1\u3055\u308c\u3066\u304d\u305f\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u3092\u53d7\u3051\u53d6\u3063\u3066\u30b5\u30fc\u30d0\u30fc\u4e0a\u306b\u4fdd\u5b58\u3059\u308b\u3002<\/p>\n<p>\u5ff5\u306e\u305f\u3081\u300124\u884c\u76ee\u306bLog::debug()\u3092\u7f6e\u3044\u3066\u3001\u53d7\u4fe1\u3057\u305f\u30c7\u30fc\u30bf\u3092\u30ed\u30b0\u306b\u8a18\u9332\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p>\u51fa\u529b\u5185\u5bb9\u306f\u3001storage\/logs\/laravel.log \u30d5\u30a1\u30a4\u30eb\u306b\u8a18\u9332\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"brush: php; first-line: 22; highlight: [24,28,29,30,31]; title: ; notranslate\" title=\"\">\r\n    public function post(Request $request)\r\n    {\r\n        \\Log::debug($request);\r\n        $msg = $request-&gt;input(&#039;message&#039;);\r\n        $sender = \\Auth::user()-&gt;id;\r\n        $recipient = $request-&gt;input(&#039;recipient&#039;);\r\n        $dir = &#039;images&#039;;\r\n        if (!empty($request-&gt;file(&#039;image&#039;))) {\r\n            $request-&gt;file(&#039;image&#039;)-&gt;store(&#039;public\/&#039;.$dir);\r\n        }\r\n        Message::create(&#x5B;\r\n            &#039;sender&#039; =&gt; $sender,\r\n            &#039;recipient&#039; =&gt; $recipient,\r\n            &#039;text&#039; =&gt; $msg,\r\n        ]);\r\n        if ($sender == $recipient) {\r\n            return redirect()-&gt;route(&#039;dashboard&#039;);\r\n        }\r\n        return redirect()-&gt;route(&#039;talk&#039;, $recipient);\r\n    }\r\n<\/pre>\n<p>30\u884c\u76ee\u3067\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u3092\u4fdd\u5b58\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u4fdd\u5b58\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u306f\u3001storage\/app\/public\/image \u306b\u4fdd\u5b58\u3055\u308c\u307e\u3059\u3002<\/p>\n<h4>\u30d5\u30a1\u30a4\u30eb\u306e\u30d1\u30b9\u3092 Message \u306b\u4fdd\u5b58\u3059\u308b<\/h4>\n<p>\u73fe\u72b6\u3067\u306f\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u3092\u4fdd\u5b58\u306f\u3067\u304d\u3066\u3044\u307e\u3059\u304c\u3001\u305d\u308c\u3092\u53c2\u7167\u3059\u308b\u65b9\u6cd5\u304c\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u306e\u30d1\u30b9\u3092\u4fdd\u5b58\u3067\u304d\u308b\u3088\u3046\u306b\u3001Message\u30e2\u30c7\u30eb\u306b\u30ab\u30e9\u30e0\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: php; highlight: [13]; title: ; notranslate\" title=\"\">\r\n&lt;?php\r\n\r\nnamespace App\\Models;\r\n\r\nuse Illuminate\\Database\\Eloquent\\Model;\r\n\r\nclass Message extends Model\r\n{\r\n    protected $fillable = &#x5B;\r\n        &#039;sender&#039;,\r\n        &#039;recipient&#039;,\r\n        &#039;text&#039;,\r\n        &#039;image&#039;,\r\n    ];\r\n\r\n}\r\n<\/pre>\n<p>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e messages \u30c6\u30fc\u30d6\u30eb\u306b image \u30ab\u30e9\u30e0\u3092\u8ffd\u52a0\u3059\u308b\u305f\u3081\u306e\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n&gt; php artisan make:migration add_image_to_messages --table=messages\r\n<\/pre>\n<p>\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u30d5\u30a1\u30a4\u30eb\u306e\u5185\u5bb9\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<pre class=\"brush: php; highlight: [15,25]; title: ; notranslate\" title=\"\">\r\n&lt;?php\r\n\r\nuse Illuminate\\Database\\Migrations\\Migration;\r\nuse Illuminate\\Database\\Schema\\Blueprint;\r\nuse Illuminate\\Support\\Facades\\Schema;\r\n\r\nreturn new class extends Migration\r\n{\r\n    \/**\r\n     * Run the migrations.\r\n     *\/\r\n    public function up(): void\r\n    {\r\n        Schema::table(&#039;messages&#039;, function (Blueprint $table) {\r\n            $table-&gt;string(&#039;image&#039;)-&gt;after(&#039;text&#039;)-&gt;nullable();\r\n        });\r\n    }\r\n\r\n    \/**\r\n     * Reverse the migrations.\r\n     *\/\r\n    public function down(): void\r\n    {\r\n        Schema::table(&#039;messages&#039;, function (Blueprint $table) {\r\n            $table-&gt;dropColumn(&#039;image&#039;);\r\n        });\r\n    }\r\n};\r\n<\/pre>\n<p>\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n&gt; php artisan migrate\r\n<\/pre>\n<p>\u3053\u308c\u3067 messages \u30c6\u30fc\u30d6\u30eb\u306b image \u30ab\u30e9\u30e0\u304c\u8ffd\u52a0\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n<p>\u6b21\u306f MessageController.php \u306b\u3001\u4fdd\u5b58\u3057\u305f\u753b\u50cf\u306e\u30d1\u30b9\u3092 Message \u306b\u4fdd\u5b58\u3059\u308b\u51e6\u7406\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: php; first-line: 22; highlight: [29,30,31,36]; title: ; notranslate\" title=\"\">\r\n    public function post(Request $request)\r\n    {\r\n        \\Log::debug($request);\r\n        $msg = $request-&gt;input(&#039;message&#039;);\r\n        $sender = \\Auth::user()-&gt;id;\r\n        $recipient = $request-&gt;input(&#039;recipient&#039;);\r\n        $dir = &#039;images&#039;;\r\n        if (!empty($request-&gt;file(&#039;image&#039;))) {\r\n            $path = $request-&gt;file(&#039;image&#039;)-&gt;store(&#039;public\/&#039;.$dir);\r\n        }\r\n        Message::create(&#x5B;\r\n            &#039;sender&#039; =&gt; $sender,\r\n            &#039;recipient&#039; =&gt; $recipient,\r\n            &#039;text&#039; =&gt; $msg,\r\n            &#039;image&#039; =&gt; $path,\r\n        ]);\r\n        if ($sender == $recipient) {\r\n            return redirect()-&gt;route(&#039;dashboard&#039;);\r\n        }\r\n        return redirect()-&gt;route(&#039;talk&#039;, $recipient);\r\n    }\r\n<\/pre>\n<p>\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u3092\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3059\u308b\u3068\u3001\u306a\u305c\u304b storage\/app\/private \u30d5\u30a9\u30eb\u30c0\u306b\u4fdd\u5b58\u3055\u308c\u308c\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u306f Laravel11 \u304b\u3089\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u4fdd\u5b58\u5148\u304c\u5909\u66f4\u3055\u308c\u3066\u3044\u308b\u305f\u3081\u3067\u3057\u305f\u3002<\/p>\n<p>config\/filesystems.php \u30d5\u30a1\u30a4\u30eb\u3092\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: php; first-line: 31; highlight: [35]; title: ; notranslate\" title=\"\">\r\n    &#039;disks&#039; =&gt; &#x5B;\r\n\r\n        &#039;local&#039; =&gt; &#x5B;\r\n            &#039;driver&#039; =&gt; &#039;local&#039;,\r\n            &#039;root&#039; =&gt; storage_path(&#039;app\/public&#039;),\r\n            &#039;serve&#039; =&gt; true,\r\n            &#039;throw&#039; =&gt; false,\r\n        ],\r\n<\/pre>\n<p>\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u5909\u66f4\u3057\u305f\u306e\u3067\u3001Laravel\u3092\u518d\u8d77\u52d5\u3057\u3001\u753b\u50cf\u3092\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3057\u306a\u304a\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u753b\u50cf\u30d5\u30a1\u30a4\u30eb\u306f storage\/app\/public\/images \u30d5\u30a9\u30eb\u30c0\u306b\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>\u3053\u306e\u307e\u307e\u3067\u306f\u30d6\u30e9\u30a6\u30b6\u4e0a\u306b\u753b\u50cf\u3092\u8868\u793a\u3067\u304d\u306a\u3044\u306e\u3067\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n&gt; php artisan storage:link\r\n<\/pre>\n<p>\u3053\u306e\u30b3\u30de\u30f3\u30c9\u306b\u3088\u308a\u3001public \u30d5\u30a9\u30eb\u30c0\u5185\u306b storage\/app\/public \u30d5\u30a9\u30eb\u30c0\u3078\u306e\u30b7\u30e7\u30fc\u30c8\u30ab\u30c3\u30c8\u304c\u4f5c\u3089\u308c\u307e\u3057\u305f\u3002<\/p>\n<p>Laravel\u3067\u306f public \u30d5\u30a9\u30eb\u30c0\u306f\u30d6\u30e9\u30a6\u30b6\u304b\u3089\u30a2\u30af\u30bb\u30b9\u53ef\u80fd\u306a\u30d5\u30a9\u30eb\u30c0\u306a\u306e\u3067\u3001\u30d6\u30e9\u30a6\u30b6\u4e0a\u3067\u3082\u8868\u793a\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>talk.blade.php \u306b\u3001\u753b\u50cf\u3092\u8868\u793a\u3059\u308b\u305f\u3081\u306e\u8981\u7d20\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: xml; first-line: 14; highlight: [20,21,22,23,24]; title: ; notranslate\" title=\"\">\r\n                &lt;div class=&quot;p-6 text-gray-900&quot;&gt;\r\n                    @foreach($messages as $m)\r\n                    &lt;div class=&quot;border pd5 @if($m-&gt;sender == \\Auth::user()-&gt;id)text-right bg-green @endif&quot;&gt;\r\n                        &lt;div&gt;\r\n                            {!! nl2br($m-&gt;text) !!}\r\n                        &lt;\/div&gt;\r\n                        @if(!empty($m-&gt;image))\r\n                        &lt;div&gt;\r\n                            &lt;img src=&quot;\/storage\/{{ $m-&gt;image }}&quot; \/&gt;\r\n                        &lt;\/div&gt;\r\n                        @endif\r\n                        &lt;div class=&quot;text-xs&quot;&gt;\r\n                            {{ $m-&gt;created_at }}\r\n                        &lt;\/div&gt;\r\n                    &lt;\/div&gt;\r\n                    @endforeach\r\n                &lt;\/div&gt;\r\n<\/pre>\n<p>\u3053\u306e\u5909\u66f4\u306b\u3088\u308a\u3001\u9001\u4fe1\u3057\u305f\u753b\u50cf\u304c\u30d6\u30e9\u30a6\u30b6\u4e0a\u306b\u8868\u793a\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<h4>\u81ea\u5206\u304c\u9001\u4fe1\u3057\u305f\u753b\u50cf\u3092\u53f3\u5bc4\u305b\u3067\u8868\u793a\u3059\u308b<\/h4>\n<p>\u3059\u3079\u3066\u306e\u753b\u50cf\u304c\u5de6\u5bc4\u305b\u3067\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u3001\u81ea\u5206\u304c\u9001\u4fe1\u3057\u305f\u753b\u50cf\u3082\u3001\u76f8\u624b\u304b\u3089\u9001\u3089\u308c\u305f\u3088\u3046\u306b\u898b\u3048\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u3092\u89e3\u6d88\u3059\u308b\u305f\u3081\u306b\u3001\u81ea\u5206\u304c\u9001\u4fe1\u3057\u305f\u753b\u50cf\u3092\u53f3\u5bc4\u305b\u3067\u8868\u793a\u3059\u308b\u3088\u3046\u306b\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n<p>\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30d5\u30a1\u30a4\u30eb layout\/app.blade.php \u306b\u3001\u753b\u50cf\u3092\u53f3\u5bc4\u305b\u3059\u308b\u305f\u3081\u306eCSS\u30af\u30e9\u30b9\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: xml; first-line: 13; highlight: [40,41,42]; title: ; notranslate\" title=\"\">\r\n        &lt;style&gt;\r\n        .username-div {\r\n            margin: 2px;\r\n        }\r\n        .friend-button {\r\n            font-size: small;\r\n            background-color: #b9f9f3;\r\n            border-radius: 5px;\r\n            padding: 3px 5px;\r\n        }\r\n        .border {\r\n            border: 1px solid gray;\r\n            border-radius: 5px;\r\n            margin-bottom: 2px;\r\n        }\r\n        .text-right {\r\n            text-align: right;\r\n        }\r\n        .pd5 {\r\n            padding: 5px;\r\n        }\r\n        .text-xs {\r\n            font-size: x-small;\r\n        }\r\n        .bg-green {\r\n            background-color: #80ff80;\r\n        }\r\n        .img-right {\r\n            margin: 0 0 0 auto;\r\n        }\r\n        &lt;\/style&gt;\r\n<\/pre>\n<p>talk.blade.php \u3067\u306f\u3001\u81ea\u5206\u304c\u9001\u4fe1\u3057\u305f\u753b\u50cf\u306b\u3060\u3051\u3001img-right \u30af\u30e9\u30b9\u3092\u9069\u7528\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: xml; first-line: 14; highlight: [22]; title: ; notranslate\" title=\"\">\r\n                &lt;div class=&quot;p-6 text-gray-900&quot;&gt;\r\n                    @foreach($messages as $m)\r\n                    &lt;div class=&quot;border pd5 @if($m-&gt;sender == \\Auth::user()-&gt;id)text-right bg-green @endif&quot;&gt;\r\n                        &lt;div&gt;\r\n                            {!! nl2br($m-&gt;text) !!}\r\n                        &lt;\/div&gt;\r\n                        @if(!empty($m-&gt;image))\r\n                        &lt;div&gt;\r\n                            &lt;img src=&quot;\/storage\/{{ $m-&gt;image }}&quot; @if($m-&gt;sender == \\Auth::user()-&gt;id) class=&quot;img-right&quot; @endif \/&gt;\r\n                        &lt;\/div&gt;\r\n                        @endif\r\n                        &lt;div class=&quot;text-xs&quot;&gt;\r\n                            {{ $m-&gt;created_at }}\r\n                        &lt;\/div&gt;\r\n                    &lt;\/div&gt;\r\n                    @endforeach\r\n                &lt;\/div&gt;\r\n<\/pre>\n<h4>\u30c0\u30c3\u30b7\u30e5\u30dc\u30fc\u30c9\u3067\u3082\u753b\u50cf\u3092\u9001\u4fe1\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b<\/h4>\n<p>\u73fe\u72b6\u3067\u306f\u30c8\u30fc\u30af\u753b\u9762\u3067\u306f\u753b\u50cf\u3092\u9001\u4fe1\u3067\u304d\u307e\u3059\u304c\u3001\u81ea\u5206\u3042\u3066\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u9001\u4fe1\u53ef\u80fd\u306a\u30c0\u30c3\u30b7\u30e5\u30dc\u30fc\u30c9\u3067\u306f\u753b\u50cf\u3092\u9001\u4fe1\u3067\u304d\u307e\u305b\u3093\u3002<\/p>\n<p>\u30c0\u30c3\u30b7\u30e5\u30dc\u30fc\u30c9\u3067\u3082\u753b\u50cf\u3092\u9001\u4fe1\u3067\u304d\u308b\u3088\u3046\u306b\u4fee\u6b63\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u30c8\u30fc\u30af\u753b\u9762\u3092\u898b\u306a\u304c\u3089\u753b\u50cf\u9001\u4fe1\u3068\u8868\u793a\u306b\u95a2\u3059\u308b\u90e8\u5206\u3092\u3001\u30c0\u30c3\u30b7\u30e5\u30dc\u30fc\u30c9\u306b\u3082\u9069\u7528\u3059\u308b\u3060\u3051\u3067\u3059\u3002<\/p>\n<pre class=\"brush: php; first-line: 8; highlight: [13,14,15,16,17,18,19,20,21,22,23,24,25,29,34,35]; title: ; notranslate\" title=\"\">\r\n    &lt;div class=&quot;py-12&quot;&gt;\r\n        &lt;div class=&quot;max-w-7xl mx-auto sm:px-6 lg:px-8&quot;&gt;\r\n            &lt;div class=&quot;bg-white overflow-hidden shadow-sm sm:rounded-lg&quot;&gt;\r\n                &lt;div class=&quot;p-6 text-gray-900&quot;&gt;\r\n                    @foreach($messages as $m)\r\n                    &lt;div class=&quot;border pd5 text-right bg-green&quot;&gt;\r\n                        &lt;div&gt;\r\n                            {!! nl2br($m-&gt;text) !!}\r\n                        &lt;\/div&gt;\r\n                        @if(!empty($m-&gt;image))\r\n                        &lt;div&gt;\r\n                            &lt;img src=&quot;\/storage\/{{ $m-&gt;image }}&quot; @if($m-&gt;sender == \\Auth::user()-&gt;id) class=&quot;img-right&quot; @endif \/&gt;\r\n                        &lt;\/div&gt;\r\n                        @endif\r\n                        &lt;div&gt;\r\n                            {{ $m-&gt;created_at }}\r\n                        &lt;\/div&gt;\r\n                    &lt;\/div&gt;\r\n                    @endforeach\r\n                &lt;\/div&gt;\r\n                &lt;div class=&quot;p-6 text-gray-900&quot;&gt;\r\n                    &lt;form action=&quot;{{ route(&#039;post&#039;) }}&quot; method=&quot;post&quot; enctype=&quot;multipart\/form-data&quot;&gt;\r\n                        @csrf\r\n                        &lt;input type=&quot;hidden&quot; name=&quot;recipient&quot; value=&quot;{{ \\Auth::user()-&gt;id }}&quot; \/&gt;\r\n                        &lt;textarea name=&quot;message&quot; required&gt;&lt;\/textarea&gt;\r\n                        &lt;br \/&gt;\r\n                        &lt;input type=&quot;file&quot; name=&quot;image&quot;&gt;\r\n                        &lt;br \/&gt;\r\n                        &lt;button&gt;\u9001\u4fe1\u3059\u308b&lt;\/button&gt;\r\n                    &lt;\/form&gt;\r\n                &lt;\/div&gt;\r\n                &lt;div&gt;\r\n                    &lt;a href=&quot;{{ route(&#039;users&#039;) }}&quot;&gt;\u30e6\u30fc\u30b6\u30fc\u4e00\u89a7&lt;\/a&gt;\r\n                &lt;\/div&gt;\r\n            &lt;\/div&gt;\r\n        &lt;\/div&gt;\r\n    &lt;\/div&gt;\r\n<\/pre>\n<h4>\u300c\u9001\u4fe1\u3059\u308b\u300d\u30dc\u30bf\u30f3\u306eCSS\u3092\u8abf\u6574\u3059\u308b<\/h4>\n<p>\u73fe\u72b6\u306e\u8868\u793a\u3067\u306f\u300c\u9001\u4fe1\u3059\u308b\u300d\u304c\u30dc\u30bf\u30f3\u306b\u898b\u3048\u306a\u3044\u305f\u3081\u3001\u30c7\u30b6\u30a4\u30f3\u7684\u306b\u3088\u304f\u306a\u3044\u3067\u3059\u306e\u3067\u30dc\u30bf\u30f3\u306b\u898b\u3048\u308b\u3088\u3046\u306bCSS\u3092\u8abf\u6574\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><a href=\"https:\/\/laravel.satoshis.jp\/wp-content\/uploads\/2024\/11\/post-button.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/laravel.satoshis.jp\/wp-content\/uploads\/2024\/11\/post-button.png\" alt=\"\" width=\"282\" height=\"159\" class=\"alignnone size-full wp-image-206\" \/><\/a><\/p>\n<h4>\u30e1\u30c3\u30bb\u30fc\u30b8\u5185\u306eURL\u3092\u30ea\u30f3\u30af\u306b\u5909\u63db\u3059\u308b<\/h4>\n<p>\u30e1\u30c3\u30bb\u30fc\u30b8\u5185\u306bURL\u304c\u3042\u3063\u305f\u5834\u5408\u306f\u81ea\u52d5\u7684\u306b\u30ea\u30f3\u30af\u306b\u5909\u63db\u3059\u308b\u6a5f\u80fd\u3092\u8ffd\u52a0\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>Message\u30af\u30e9\u30b9\u306b\u30e1\u30bd\u30c3\u30c9\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: php; highlight: [16,17,18,19,20,21,22]; title: ; notranslate\" title=\"\">\r\n&lt;?php\r\n\r\nnamespace App\\Models;\r\n\r\nuse Illuminate\\Database\\Eloquent\\Model;\r\n\r\nclass Message extends Model\r\n{\r\n    protected $fillable = &#x5B;\r\n        &#039;sender&#039;,\r\n        &#039;recipient&#039;,\r\n        &#039;text&#039;,\r\n        &#039;image&#039;,\r\n    ];\r\n\r\n    public function getAnchoredText()\r\n    {\r\n        $s = $this-&gt;text;\r\n        $pattern = &#039;\/^https?:\\\/\\\/&#x5B;^\\s \u3000\\\\\\|`^&quot;\\&#039;(){}&lt;&gt;\\&#x5B;\\]]*$\/&#039;;\r\n        $linked = preg_replace($pattern, &#039;&lt;a href=&quot;$0&quot; target=&quot;_blank&quot;&gt;$0&lt;\/a&gt;&#039;, $s);\r\n        return $linked;\r\n    }\r\n}\r\n<\/pre>\n<p>talk.blade.php \u5185\u3067\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u30c6\u30ad\u30b9\u30c8\u3092\u51fa\u529b\u3057\u3066\u3044\u308b\u90e8\u5206\u3092\u3001\u65b0\u3057\u3044\u30e1\u30bd\u30c3\u30c9\u306e\u51fa\u529b\u306b\u7f6e\u304d\u63db\u3048\u307e\u3059\u3002<\/p>\n<pre class=\"brush: xml; first-line: 14; highlight: [18]; title: ; notranslate\" title=\"\">\r\n                &lt;div class=&quot;p-6 text-gray-900&quot;&gt;\r\n                    @foreach($messages as $m)\r\n                    &lt;div class=&quot;border pd5 @if($m-&gt;sender == \\Auth::user()-&gt;id)text-right bg-green @endif&quot;&gt;\r\n                        &lt;div&gt;\r\n                            {!! nl2br($m-&gt;getAnchoredText()) !!}\r\n                        &lt;\/div&gt;\r\n                        @if(!empty($m-&gt;image))\r\n                        &lt;div&gt;\r\n                            &lt;img src=&quot;\/storage\/{{ $m-&gt;image }}&quot; @if($m-&gt;sender == \\Auth::user()-&gt;id) class=&quot;img-right&quot; @endif \/&gt;\r\n                        &lt;\/div&gt;\r\n                        @endif\r\n                        &lt;div class=&quot;text-xs&quot;&gt;\r\n                            {{ $m-&gt;created_at }}\r\n                        &lt;\/div&gt;\r\n                    &lt;\/div&gt;\r\n                    @endforeach\r\n                &lt;\/div&gt;\r\n\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u7ba1\u7406\u306bgit\u3092\u4f7f\u7528\u3059\u308b Laravel\u306ebreeze\u307e\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u3089\u3001\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3092git\u3067\u7ba1\u7406\u3059\u308b\u3088\u3046\u306b\u3057\u307e\u3057\u3087\u3046\u3002 \u307e\u305a\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067\u30e6\u30fc\u30b6\u30fc\u540d\u3068\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3092 &#8230; <\/p>\n","protected":false},"author":1,"featured_media":143,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-140","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-basics"],"_links":{"self":[{"href":"https:\/\/laravel.satoshis.jp\/index.php?rest_route=\/wp\/v2\/posts\/140","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/laravel.satoshis.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/laravel.satoshis.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/laravel.satoshis.jp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/laravel.satoshis.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=140"}],"version-history":[{"count":55,"href":"https:\/\/laravel.satoshis.jp\/index.php?rest_route=\/wp\/v2\/posts\/140\/revisions"}],"predecessor-version":[{"id":209,"href":"https:\/\/laravel.satoshis.jp\/index.php?rest_route=\/wp\/v2\/posts\/140\/revisions\/209"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/laravel.satoshis.jp\/index.php?rest_route=\/wp\/v2\/media\/143"}],"wp:attachment":[{"href":"https:\/\/laravel.satoshis.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=140"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/laravel.satoshis.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=140"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/laravel.satoshis.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=140"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}