{"id":1668,"date":"2023-03-20T15:18:38","date_gmt":"2023-03-20T06:18:38","guid":{"rendered":"https:\/\/trend-appsweb.com\/myportfolio\/?p=1668"},"modified":"2023-03-25T07:21:50","modified_gmt":"2023-03-24T22:21:50","slug":"laraveljavascript%e3%81%a7%e9%9d%9e%e5%90%8c%e6%9c%9f%e5%9e%8b%e3%81%ae%e3%81%a7%e3%83%81%e3%83%a3%e3%83%83%e3%83%88%e3%82%92%e4%bd%9c%e3%81%a3%e3%81%a6%e3%81%bf%e3%82%8b","status":"publish","type":"post","link":"https:\/\/trend-appsweb.com\/myportfolio\/?p=1668","title":{"rendered":"Laravel+JavaScript\u3067\u975e\u540c\u671f\u578b\u306e\u30c1\u30e3\u30c3\u30c8\u3092\u4f5c\u3063\u3066\u307f\u308b\u2460"},"content":{"rendered":"<h3 class=\"midashi\">\u30c6\u30fc\u30de<\/h3>\n<p>\u3053\u3093\u306b\u3061\u306f\uff01naoto555\u3067\u3059\u3002<br \/>\n<span style=\"color: #0000ff;\"><span style=\"color: #000000;\">\u4eca\u56de\u306f\u3001<span>Laravel+JavaScript\u3067\u975e\u540c\u671f\u578b\u306e\u30c1\u30e3\u30c3\u30c8\u3092\u4f5c\u6210\u3059\u308b\u65b9\u6cd5\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/span><\/span><\/span><\/p>\n<p><span>\u30c1\u30e3\u30c3\u30c8\u30a2\u30d7\u30ea\u306f\u3001Web\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306b\u6b20\u304b\u305b\u306a\u3044\u6a5f\u80fd\u306e1\u3064\u3067\u3001\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u3067\u306e\u30b3\u30df\u30e5\u30cb\u30b1\u30fc\u30b7\u30e7\u30f3\u306b\u5229\u7528\u3055\u308c\u307e\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001Laravel\u3068JavaScript\u3092\u4f7f\u7528\u3057\u3066\u3001\u7c21\u5358\u306a\u30c1\u30e3\u30c3\u30c8\u30a2\u30d7\u30ea\u3092\u4f5c\u6210\u3059\u308b\u624b\u9806\u3092\u8aac\u660e\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/span><\/p>\n<p>\u3053\u3053\u3067\u8a00\u3046\u975e\u540c\u671f\u3068\u306f\u3001<span>\u4e00\u3064\u306e\u51e6\u7406\u304c\u5b8c\u4e86\u3059\u308b\u307e\u3067\u5f85\u305f\u305a\u306b\u3001\u4ed6\u306e\u51e6\u7406\u3092\u540c\u6642\u306b\u5b9f\u884c\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u51e6\u7406\u306e\u3053\u3068\u3067\u3059\u3002<\/span><br \/>\n<span>\u4eca\u56de\u306eLaravel+JavaScript\u3067\u975e\u540c\u671f\u578b\u306e\u30c1\u30e3\u30c3\u30c8\u3067\u306f\u3001\u753b\u9762\u8868\u793a\u306e\u66f4\u65b0\u3092\u975e\u540c\u671f\u3067\u884c\u3046\u3053\u3068\u3067\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u6253\u3063\u3066\u3044\u308b\u6700\u4e2d\u306b\u753b\u9762\u306e\u8868\u793a\u66f4\u65b0\u304c\u59cb\u307e\u308a\u3001\u6253\u3063\u3066\u3044\u305f\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u9014\u4e2d\u3067\u6d88\u3048\u3066\u3057\u307e\u3046\u306a\u3069\u306e\u304c\u306a\u3044\u3088\u3046\u306a\u30c1\u30e3\u30c3\u30c8\u30a2\u30d7\u30ea\u3092\u4f5c\u6210\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/span><\/p>\n<p><span>\u30dc\u30ea\u30e5\u30fc\u30e0\u304c\u591a\u3044\u306e\u30672\u56de\u306b\u5206\u3051\u3066\u624b\u9806\u306e\u307b\u3046\u89e3\u8aac\u3057\u3066\u3044\u304d\u307e\u3059\u3002(\u5f8c\u7de8\u306f<a href=\"https:\/\/trend-appsweb.com\/myportfolio\/?p=1733\">\u3053\u3061\u3089<\/a>)<br \/>\n\u7b2c1\u56de\u76ee\u306e\u4eca\u56de\u306f\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u3068\u30d3\u30e5\u30fc\u306e\u4f5c\u6210\u304a\u3088\u3073\u9001\u4fe1\u3057\u305f\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u767b\u9332\u3059\u308b\u51e6\u7406\u307e\u3067\u3092\u884c\u3063\u3066\u3044\u3053\u3046\u3068\u601d\u3044\u307e\u3059\u3002<\/span><\/p>\n<p><span>\u4eca\u56de\u306f\u3001\u52d5\u4f5c\u78ba\u8a8d\u3057\u3084\u3059\u3044\u3088\u3046\u306b\u30c1\u30e3\u30c3\u30c8\u3067\u5bfe\u8a71\u3057\u3066\u3044\u308b2\u4eba\u5206\u306e\u753b\u9762\u3092\u5de6\u53f3\u306b\u4e26\u3079\u3066\u8868\u793a\u3057\u3066\u3044\u307e\u3059\u3002\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u5165\u529b\u3057\u9001\u4fe1\u30dc\u30bf\u30f3\u3092\u62bc\u3059\u3068\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3078\u306e\u767b\u9332\u3092\u884c\u3044\u3001\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u304b\u3089console\u306b&#8217;\u9001\u4fe1\u5b8c\u4e86&#8217;\u3068\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u8fd4\u3063\u3066\u304f\u308b\u3068\u3053\u308d\u307e\u3067\u3092\u4f5c\u6210\u3057\u3066\u3044\u304d\u307e\u3059\u3002\u4eca\u56de\u306e\u5185\u5bb9\u3067\u306f\u3001\u307e\u3060\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u306b\u30e1\u30c3\u30bb\u30fc\u30b8\u753b\u9762\u306e\u66f4\u65b0\u306f\u3055\u308c\u307e\u305b\u3093\u3002<\/span><span style=\"color: #0000ff;\">(2023.3\u8a18\u8f09)<\/span><\/p>\n<div style=\"width: 575px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-1668-1\" width=\"575\" height=\"379\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/trend-appsweb.com\/wp-content\/uploads\/2023\/03\/20230325_031153.mp4?_=1\" \/><a href=\"https:\/\/trend-appsweb.com\/wp-content\/uploads\/2023\/03\/20230325_031153.mp4\">https:\/\/trend-appsweb.com\/wp-content\/uploads\/2023\/03\/20230325_031153.mp4<\/a><\/video><\/div>\n<h3 class=\"midashi\">\u958b\u767a\u74b0\u5883<\/h3>\n<div>\n<table style=\"border-collapse: collapse; width: 52.5389%; height: 230px;\">\n<tbody>\n<tr style=\"height: 46px;\">\n<td style=\"width: 28.9191%; height: 46px;\">\u7d71\u5408\u958b\u767a\u74b0\u5883<\/td>\n<td style=\"width: 29.3499%; height: 46px;\">aws cloud9<\/td>\n<\/tr>\n<tr style=\"height: 46px;\">\n<td style=\"width: 28.9191%; height: 46px;\">PHP<\/td>\n<td style=\"width: 29.3499%; height: 46px;\">8.1.17<\/td>\n<\/tr>\n<tr style=\"height: 46px;\">\n<td style=\"width: 28.9191%; height: 46px;\">Laravel<\/td>\n<td style=\"width: 29.3499%; height: 46px;\">9.52.4<\/td>\n<\/tr>\n<tr style=\"height: 46px;\">\n<td style=\"width: 28.9191%; height: 46px;\">login\u6a5f\u80fd<\/td>\n<td style=\"width: 29.3499%; height: 46px;\">Laravel\/jetstream(livewire)<\/td>\n<\/tr>\n<tr style=\"height: 46px;\">\n<td style=\"width: 28.9191%; height: 46px;\">Database<\/td>\n<td style=\"width: 29.3499%; height: 46px;\">SQlite(version 3.7.17)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h3 class=\"midashi\">\u89e3\u8aac<\/h3>\n<h4 class=\"tejun\">\u2460\u4e8b\u524d\u6e96\u5099<\/h4>\n<p>\u300cAsynchronousChat\u300d\u3068\u3044\u3046\u30a2\u30d7\u30ea\u540d\u3067Laravel\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002Laravel\u306e\u5c0e\u5165\u306e\u65b9\u6cd5\u306b\u95a2\u3057\u3066\u306f\u3001\u4ee5\u524d\u516c\u958b\u3057\u305f&#8221;<a href=\"https:\/\/trend-appsweb.com\/myportfolio\/?p=721\" style=\"text-decoration: none;\">Laravel\u958b\u767a\u74b0\u5883\u69cb\u7bc9~\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u306e\u4f5c\u6210<\/a>&#8220;\u306b\u8a73\u7d30\u306a\u3084\u308a\u304b\u305f\u3092\u307e\u3068\u3081\u3066\u3044\u307e\u3059\u306e\u3067\u3001<a href=\"https:\/\/trend-appsweb.com\/myportfolio\/?p=721\" style=\"text-decoration: none;\">\u3053\u3061\u3089\u306e\u8a18\u4e8b<\/a>\u3092\u3054\u53c2\u7167\u4e0b\u3055\u3044\u3002<br \/>\n\u4ee5\u4e0b\u306e\u624b\u9806\u3067\u3001Tinker\u3092\u4f7f\u7528\u3057\u3066User\u3092\u767b\u9332\u3057\u307e\u3059\u3002User1\u3068User2\u3092\u4f5c\u3063\u3066\u3053\u306e\u3075\u305f\u308a\u306b\u30c1\u30e3\u30c3\u30c8\u5bfe\u8a71\u3092\u3055\u305b\u3066\u3044\u3053\u3046\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<div class=\"hcb_wrap\" style=\"margin: 0;\">\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code># Tinker\u306e\u8d77\u52d5\r\n<span>php artisan tinker\r\n\r\n# User1\u306e\u767b\u9332\r\n$user = new User();\r\n$user-&gt;name = 'USER1';\r\n$user-&gt;email = 'email1@example.com';\r\n$user-&gt;password = $user-&gt;password = Hash::make('password');\r\n$user-&gt;save();\r\n\r\n# User2\u306e\u767b\u9332\r\n$user = new User();\r\n$user-&gt;name = 'USER2';\r\n$user-&gt;email = 'email2@example.com';\r\n$user-&gt;password = $user-&gt;password = Hash::make('password');\r\n$user-&gt;save();\r\n\r\n# Tinker\u306e\u7d42\u4e86\r\nquit\r\n<\/span><\/code><\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<h4 class=\"tejun\">\u2461Chat\u30e2\u30c7\u30eb\u3068\u30c6\u30fc\u30d6\u30eb\u3001\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u306e\u4f5c\u6210<\/h4>\n<p>\u307e\u305a\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u6253\u3061\u3001Chat\u30e2\u30c7\u30eb\u3068Chat\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code># \u30e2\u30c7\u30eb\u3001\u30c6\u30fc\u30d6\u30eb\u3001\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u3092\u4e00\u6c17\u306b\u4f5c\u6210\r\nphp artisan make:model Chat --all\r\n<\/code><\/pre>\n<\/div>\n<h4 class=\"tejun\">\u2462\u30c6\u30fc\u30d6\u30eb\u306e\u7de8\u96c6<\/h4>\n<p>\u4f5c\u6210\u3055\u308c\u305f\u30c6\u30fc\u30d6\u30eb\u3092\u7de8\u96c6\u3057\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p class=\"file_name\"><em>database\/migrations\/XXXX_XX_XX_XXXXXX_create_chats_table.php<\/em><\/p>\n<div class=\"hcb_wrap\" style=\"margin: 0;\">\n<pre class=\"prism line-numbers lang-php\" data-lang=\"PHP\"><code>public function up()\r\n{\r\n    Schema::create('chats', function (Blueprint $table) {\r\n        $table-&gt;id();\r\n        $table-&gt;bigInteger('send')-&gt;unsigned();    \/\/\u9001\u4fe1\u30e6\u30fc\u30b6\u30fc\u306eID\r\n        $table-&gt;bigInteger('recieve')-&gt;unsigned(); \/\/\u53d7\u4fe1\u30e6\u30fc\u30b6\u30fc\u306eID\r\n        $table-&gt;text('message');                   \/\/\u30e1\u30c3\u30bb\u30fc\u30b8\u672c\u6587\r\n        $table-&gt;timestamps();\r\n    });\r\n}\r\n\r\n<\/code><\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<p>\u30bf\u30fc\u30df\u30ca\u30eb\u306b\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u6253\u3063\u3066\u3001\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u306e\u5b9f\u884c<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code><span style=\"color: #008000;\"><span style=\"color: #ffffff;\"><span class=\"hljs-attribute\">php<\/span><span> artisan migrate<\/span><\/span><\/span><\/code><\/pre>\n<\/div>\n<h4 class=\"tejun\">\u2463\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u306e\u7de8\u96c6<\/h4>\n<p>\u7d9a\u3044\u3066\u3001\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\u306e\u4e2d\u8eab\u3092\u7de8\u96c6\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p class=\"file_name\"><em>app\/Http\/Controllers\/ChatController.php<\/em><\/p>\n<div class=\"hcb_wrap\" style=\"margin: 0;\">\n<pre class=\"prism line-numbers lang-php\" data-lang=\"PHP\"><code>\/\/use App\\Http\\Requests\\StoreChatRequest;\r\n\/\/use App\\Http\\Requests\\UpdateChatRequest;\r\nuse App\\Models\\Chat;\r\nuse App\\Models\\User;                   \/\/\u8ffd\u52a0\r\nuse Illuminate\\Http\\Request;           \/\/\u8ffd\u52a0\r\n\r\n\/\/------------------------------\u4e2d\u7565------------------------------\r\n\r\npublic function store(Request $request)\r\n{\r\n    $chat = new Chat();\r\n\r\n    $chat-&gt;send = $request-&gt;input('send');\r\n    $chat-&gt;recieve = $request-&gt;input('recieve');\r\n    $chat-&gt;message = $request-&gt;input('message');\r\n\r\n    $chat-&gt;save();\r\n\r\n    $param = [\r\n        'done' =&gt; '\u9001\u4fe1\u5b8c\u4e86', \r\n    ];\r\n\r\n    return response()-&gt;json($param);\r\n}\r\n\r\npublic function showchat()\r\n{\r\n    $messages = Chat::all();\r\n    $user1 = User::find(1);     \/\/user1\u306e\u60c5\u5831\u53d6\u5f97\r\n    $user2 = User::find(2);     \/\/user2\u306e\u60c5\u5831\u53d6\u5f97\r\n    return view('chats.showchat', compact('messages'));\r\n}<\/code><\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<div class=\"kaisetsu\">\n<p>\u4e0a\u8a18store\u306e\u90e8\u5206\u306e\u51e6\u7406\u306b\u95a2\u3057\u3066\u3001\u7c21\u5358\u306b\u8aac\u660e\u3057\u307e\u3059\u3002<br \/>\n\u3053\u306e\u30b3\u30fc\u30c9\u306f\u3001HTTP POST\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u53d7\u3051\u53d6\u308a\u3001\u305d\u306e\u5185\u5bb9\u3092\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u4fdd\u5b58\u3057\u307e\u3059\u3002\u305d\u3057\u3066\u3001\u51e6\u7406\u304c\u5b8c\u4e86\u3057\u305f\u5f8c\u306bJSON\u5f62\u5f0f\u3067\u30ec\u30b9\u30dd\u30f3\u30b9\u3092\u8fd4\u3057\u307e\u3059\u3002<\/p>\n<p>\u307e\u305a\u3001$request\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u4f7f\u7528\u3057\u3066POST\u3055\u308c\u305f\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n$request-&gt;input(&#8216;send&#8217;)\u306fPOST\u3055\u308c\u305f\u30c7\u30fc\u30bf\u306e\u4e2d\u304b\u3089send\u3068\u3044\u3046\u540d\u524d\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u53d6\u5f97\u3059\u308b\u3053\u3068\u3092\u610f\u5473\u3057\u3066\u3044\u307e\u3059\u3002\u6b21\u306bChat\u30e2\u30c7\u30eb\u306e\u65b0\u3057\u3044\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u4f5c\u6210\u3057\u3001POST\u3055\u308c\u305f\u30c7\u30fc\u30bf\u3092\u4f7f\u7528\u3057\u3066\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u53d6\u5f97\u3057\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u5834\u5408\u3001done\u3068\u3044\u3046\u540d\u524d\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u306b\u300c\u9001\u4fe1\u5b8c\u4e86\u300d\u3068\u3044\u3046\u6587\u5b57\u5217\u3092\u8a2d\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002\u6700\u5f8c\u306b\u3001response()-&gt;json()\u95a2\u6570\u3092\u4f7f\u7528\u3057\u3066\u3001$param\u5909\u6570\u3092JSON\u5f62\u5f0f\u3067\u8fd4\u3057\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001JavaScript\u306a\u3069\u306e\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u5074\u3067\u3001\u30ec\u30b9\u30dd\u30f3\u30b9\u3068\u3057\u3066\u8fd4\u3055\u308c\u305fJSON\u30c7\u30fc\u30bf\u3092\u7c21\u5358\u306b\u51e6\u7406\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<\/div>\n<p>&nbsp;<\/p>\n<h4 class=\"tejun\">\u2464\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u306e\u8a2d\u5b9a<\/h4>\n<p class=\"file_name\"><em>web.php\u3092\u7de8\u96c6\u3057\u3066URI\u3092\u8a2d\u5b9a\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/em><\/p>\n<p>&nbsp;<\/p>\n<p class=\"file_name\"><em><\/em><em>routes\/web.php<\/em><\/p>\n<div class=\"hcb_wrap\" style=\"margin: 0;\">\n<pre class=\"prism line-numbers lang-html\" data-lang=\"HTML\"><code>use App\\Http\\Controllers\\ChatController;\r\n\r\n\/\/----------------------------------------\u4e2d\u7565----------------------------------------\r\n\r\nRoute::get('\/showchat', [ChatController::class, 'showchat'])-&gt;name(chat.showchat);\r\n\r\n<\/code><\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<h4 class=\"tejun\">\u2465\u30d3\u30e5\u30fc\u306e\u4f5c\u6210<\/h4>\n<p>\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u6253\u3063\u3066\u30d3\u30e5\u30fc\u3092\u4f5c\u6210\u3057\u3001\u4f5c\u6210\u3055\u308c\u305f\u30d3\u30e5\u30fc\u3092\u7de8\u96c6\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>#\u30d5\u30a9\u30eb\u30c0\u306e\u4f5c\u6210\r\nmkdir resources\/views\/chats\r\n\r\n#\u30d3\u30e5\u30fc\u30d5\u30a1\u30a4\u30eb\u306e\u4f5c\u6210\r\ntouch resources\/views\/chats\/showchat.blade.php<\/code><\/pre>\n<\/div>\n<p class=\"file_name\"><em>resources\/views\/chats\/showchat.blade.php<\/em><\/p>\n<div class=\"hcb_wrap\" style=\"margin: 0;\">\n<pre class=\"prism line-numbers lang-html\" data-lang=\"HTML\"><code>&lt;!DOCTYPE html&gt;\r\n&lt;html&gt;\r\n    &lt;head&gt;\r\n        &lt;link href=\"{{ secure_asset('css\/styles.css') }}\" rel=\"stylesheet\"&gt;\r\n        &lt;!-- CSRF Token --&gt;\r\n        &lt;meta name=\"csrf-token\" content=\"{{ csrf_token() }}\"&gt;\r\n    &lt;\/head&gt;\r\n\r\n    &lt;body&gt;\r\n        &lt;div class=\"content\"&gt;\r\n            &lt;div class=\"chat_content\" id=\"chat_content1\"&gt;\r\n                &lt;div class=\"chat_content\"&gt;\r\n                    &lt;h3&gt;User1&lt;\/h3&gt;\r\n                    @foreach($messages as $message)\r\n                        @if($message-&gt;send == $user1-&gt;id)\r\n                            &lt;div class=\"my_message\"&gt;\r\n                                &lt;div class=\"chatting\"&gt;\r\n                                    &lt;p class=\"message\"&gt;{{ $message-&gt;message }}&lt;\/p&gt;\r\n                                    &lt;p class=\"date\"&gt;{{ $message-&gt;created_at-&gt;format('Y-m-d H:i') }}&lt;\/p&gt;\r\n                                &lt;\/div&gt;\r\n                            &lt;\/div&gt;\r\n                        @else\r\n                            &lt;div class=\"others_message\"&gt;\r\n                                &lt;div class=\"chatting\"&gt;\r\n                                    &lt;p class=\"message\"&gt;{{ $message-&gt;message }}&lt;\/p&gt;\r\n                                    &lt;p class=\"date\"&gt;{{ $message-&gt;created_at-&gt;format('Y-m-d H:i') }}&lt;\/p&gt;\r\n                                    &lt;input class=\"message_id1\" style=\"display:none;\" value={{ $message-&gt;id }}&gt;\r\n                                &lt;\/div&gt;\r\n                            &lt;\/div&gt;\r\n                        @endif\r\n                    @endforeach\r\n                &lt;\/div&gt;\r\n                &lt;div class=\"send_message\" id=\"send_message1\"&gt;\r\n                    &lt;form id=\"send_message_form1\"&gt;\r\n                         &lt;input name=\"send\" type=\"hidden\" value=\"{{ $user1-&gt;id }}\"&gt;\r\n                         &lt;input name=\"recieve\" type=\"hidden\" value=\"{{ $user2-&gt;id }}\"&gt;\r\n                         &lt;textarea name=\"message\" type=\"textarea\" class=\"input_message\"&gt;&lt;\/textarea&gt;\r\n                         &lt;button type=\"button\" class=\"send_button\" onclick=\"new_message1()\"&gt;\u9001\u4fe1&lt;\/button&gt;\r\n                    &lt;\/form&gt;\r\n                &lt;\/div&gt;\r\n            &lt;\/div&gt;\r\n\r\n            &lt;div class=\"main_chat\"&gt;\r\n                &lt;div class=\"chat_content\" id=\"chat_content2\"&gt;\r\n                    &lt;h3&gt;User2&lt;\/h3&gt;\r\n                    @foreach($messages as $message)\r\n                        @if($message-&gt;send == $user2-&gt;id)\r\n                            &lt;div class=\"my_message\"&gt;\r\n                                &lt;div class=\"chatting\"&gt;\r\n                                    &lt;p class=\"message\"&gt;{{ $message-&gt;message }}&lt;\/p&gt;\r\n                                    &lt;p class=\"date\"&gt;{{ $message-&gt;created_at-&gt;format('Y-m-d H:i') }}&lt;\/p&gt;\r\n                                &lt;\/div&gt;\r\n                            &lt;\/div&gt;\r\n                        @else\r\n                            &lt;div class=\"others_message\"&gt;\r\n                                &lt;div class=\"chatting\"&gt;\r\n                                    &lt;p class=\"message\"&gt;{{ $message-&gt;message }}&lt;\/p&gt;\r\n                                    &lt;p class=\"date\"&gt;{{ $message-&gt;created_at-&gt;format('Y-m-d H:i') }}&lt;\/p&gt;\r\n                                    &lt;input class=\"message_id2\" style=\"display:none;\" value={{ $message-&gt;id }}&gt;\r\n                                &lt;\/div&gt;\r\n                            &lt;\/div&gt;\r\n                        @endif\r\n                    @endforeach\r\n                &lt;\/div&gt;\r\n                &lt;div class=\"send_message\" id=\"send_message2\"&gt;\r\n                    &lt;form id=\"send_message_form2\"&gt;\r\n                        &lt;input name=\"send\" type=\"hidden\" value=\"{{ $user2-&gt;id }}\"&gt;\r\n                        &lt;input name=\"recieve\" type=\"hidden\" value=\"{{ $user1-&gt;id }}\"&gt;\r\n                        &lt;textarea name=\"message\" type=\"textarea\" class=\"input_message\"&gt;&lt;\/textarea&gt;\r\n                        &lt;button type=\"button\" class=\"send_button\" onclick=\"new_message2()\"&gt;\u9001\u4fe1&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\r\n        &lt;script type=\"text\/javascript\"&gt;\r\n            \/\/\u3053\u3053\u306bJavaScript\u3092\u8a18\u8f09\r\n        &lt;\/script&gt;\r\n    &lt;\/body&gt;\r\n&lt;\/html&gt;<\/code><\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<h4 class=\"tejun\">\u2465CSS\u30d5\u30a1\u30a4\u30eb\u306e\u4f5c\u6210<\/h4>\n<p>\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u30bf\u30fc\u30df\u30ca\u30eb\u3067\u6253\u3061\u3001CSS\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code># public\u30d5\u30a9\u30eb\u30c0\u306e\u914d\u4e0b\u306bcss\u30d5\u30a9\u30eb\u30c0\u3092\u4f5c\u6210\r\nmkdir public\/css\r\n\r\n# css\u30d5\u30a9\u30eb\u30c0\u306e\u914d\u4e0b\u306bstyle.css\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\r\ntouch public\/css\/styles.css<\/code><\/pre>\n<\/div>\n<p>\u4f5c\u6210\u3057\u305f\u30b9\u30bf\u30a4\u30eb\u30b7\u30fc\u30c8\u3092\u7de8\u96c6\u3057\u3066\u3044\u304f\u3002<\/p>\n<p class=\"file_name\"><em>public\/css\/styles.css<\/em><\/p>\n<div class=\"hcb_wrap\" style=\"margin: 0;\">\n<pre class=\"prism line-numbers lang-css\" data-lang=\"CSS\"><code>.content {\r\n    display: flex;\r\n    justify-content: space-between;\r\n    margin: 50px auto;\r\n    width: 80%;\r\n}\r\n\r\n.main_chat {\r\n    width: 100%;\r\n    height: 80vh;\r\n    margin: 0 20px;\r\n    border-radius: 10px;\r\n    padding: 0 0 0 10px;\r\n    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);\r\n    background-color: #f2f2f2;\r\n}\r\n\r\n.chat_content {\r\n    height: 75%;\r\n    overflow: scroll;\r\n}\r\n\r\n.chat_content::-webkit-scrollbar {\r\n    width: 5px;\r\n    height: 5px;\r\n}\r\n\r\n.chat_content::-webkit-scrollbar-thumb {\r\n    background: rgba(0, 0, 0, 0.5);\r\n}\r\n\r\n.chat_content::-webkit-scrollbar-track {\r\n    background: rgba(0, 0, 0, 0.1);\r\n}\r\n\r\n.my_message {\r\n    width: 100%;\r\n    padding-top: 20px;\r\n    text-align: right;\r\n}\r\n\r\n.my_message .chatting {\r\n    display: inline-block;\r\n    position: relative;\r\n    margin: 0 25px 30px 0;\r\n    padding: 0 20px;\r\n    max-width: 80%;\r\n    min-width: 50%;\r\n    border-radius: 12px;\r\n    background-color:#e0ffe0;\r\n    text-align: left;\r\n}\r\n\r\n.my_message .chatting:before {\r\n    content: \"\";\r\n    display: inline-block;\r\n    position: absolute;\r\n    top: 15px;\r\n    right: -30px;\r\n    border: 15px solid transparent;\r\n    border-left: 25px solid #e0ffe0;\r\n}\r\n\r\n.message {\r\n    white-space: pre;\r\n}\r\n\r\n.send_user, .date {\r\n    margin: 0 20px 0 0;\r\n    color: #c0c0c0;\r\n    font-size: 13px;\r\n}\r\n\r\n.date {\r\n    margin-top: -15px;\r\n}\r\n\r\n.others_message {\r\n    width: 100%;\r\n    padding-top: 20px;\r\n    text-align: left;\r\n}\r\n\r\n.others_message .chatting {\r\n    display: inline-block;\r\n    position: relative;\r\n    margin: 0 0 30px 15px;\r\n    padding: 0 20px;\r\n    max-width: 80%;\r\n    min-width: 50%;\r\n    border-radius: 12px;\r\n    background-color:white;\r\n    text-align: left;\r\n}\r\n\r\n.others_message .chatting:after {\r\n    content: \"\";\r\n    display: inline-block;\r\n    position: absolute;\r\n    top: 15px;\r\n    left: -30px;\r\n    border: 15px solid transparent;\r\n    border-right: 25px solid white;\r\n}\r\n\r\n.send_message {\r\n    position: relative;\r\n    width: 100%;\r\n    height: 25%;\r\n    border-top:solid 1px gray;\r\n    overflow-y: scroll;\r\n}\r\n\r\n.send_message::-webkit-scrollbar {\r\n    width: 5px;\r\n    height: 5px;\r\n}\r\n\r\n.send_message::-webkit-scrollbar-thumb {\r\n    background: rgba(0, 0, 0, 0.5);\r\n}\r\n\r\n.send_message::-webkit-scrollbar-track {\r\n    background: rgba(0, 0, 0, 0.1);\r\n}\r\n\r\n.input_message {\r\n    width: 98%;\r\n    height: 18vh;\r\n    margin: 0 auto;\r\n}\r\n\r\n.send_message .send_button {\r\n    position: absolute;\r\n    bottom: 20px;\r\n    right: 20px;\r\n    background-color: lightblue;\r\n    color: white;\r\n}<\/code><\/pre>\n<\/div>\n<p>\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3067\u306f\u5439\u304d\u51fa\u3057\u306e\u4e09\u89d2\u5f62\u306e\u90e8\u5206\u3092\u4f5c\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-css\" data-lang=\"CSS\"><code>.my_message .chatting:before {\r\n    content: \"\"; \r\n    display: inline-block;\r\n    position: absolute;\r\n    top: 15px;\r\n    right: -30px;\r\n    border: 15px solid transparent;\r\n    border-left: 25px solid #e0ffe0;\r\n}<\/code><\/pre>\n<\/div>\n<p>&#8220;<span style=\"background-color: lightgray;\">.chatting::befor<\/span>&#8220;\u306f\u3001<span>.chatting\u30af\u30e9\u30b9\u306b\u5bfe\u3057\u3066\u3001\u7591\u4f3c\u8981\u7d20\u3092\u8ffd\u52a0\u3059\u308b\u3088\u3046\u306b\u6307\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002\u7591\u4f3c\u8981\u7d20\u3068\u306f\u5b58\u5728\u3057\u306a\u3044\u67b6\u7a7a\u306e\u8981\u7d20\u306e\u3053\u3068\u3067::before\u3084::after\u306a\u3069\u3067\u7591\u4f3c\u8981\u7d20\u3092\u8ffd\u52a0\u3059\u308b\u65b9\u6cd5\u304c\u3042\u308a\u307e\u3059\u3002\u306a\u304a\u3001content\u30d7\u30ed\u30d1\u30c6\u30a3\u306e\u5024\u306b\u306f\u3001\u5fc5\u305a\u4f55\u304b\u3057\u3089\u306e\u5024\u3092\u6307\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u305f\u3081\u3001\u3053\u3053\u3067\u306f&#8221;<span style=\"background-color: lightgray;\">content: &#8220;&#8221;;<\/span>&#8220;\u306b\u3066\u7a7a\u306e\u6587\u5b57\u5217\u3092\u6307\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n::before\u3068::after\u306e\u9055\u3044\u306b\u95a2\u3057\u3066\u306f\u4e0b\u56f3\u306e\u3088\u3046\u306b\u8981\u7d20\u306e\u624b\u524d\u5074\u306b\u7591\u4f3c\u8981\u7d20\u304c\u914d\u7f6e\u3055\u308c\u308b\u306e\u304cbefore\uff0c\u8981\u7d20\u306e\u5965\u5074\u306b\u7591\u4f3c\u8981\u7d20\u304c\u914d\u7f6e\u3055\u308c\u308b\u306e\u304cafter\u3067\u3059\u3002<br \/>\n<\/span><\/p>\n<p><a href=\"https:\/\/trend-appsweb.com\/wp-content\/uploads\/2023\/03\/beforeafter.png\"><img fetchpriority=\"high\" decoding=\"async\" src=\"https:\/\/trend-appsweb.com\/wp-content\/uploads\/2023\/03\/beforeafter-1024x347.png\" alt=\"\" width=\"1024\" height=\"347\" class=\"alignnone size-large wp-image-1712\" srcset=\"https:\/\/trend-appsweb.com\/wp-content\/uploads\/2023\/03\/beforeafter-1024x347.png 1024w, https:\/\/trend-appsweb.com\/wp-content\/uploads\/2023\/03\/beforeafter-300x102.png 300w, https:\/\/trend-appsweb.com\/wp-content\/uploads\/2023\/03\/beforeafter-768x260.png 768w, https:\/\/trend-appsweb.com\/wp-content\/uploads\/2023\/03\/beforeafter-1536x521.png 1536w, https:\/\/trend-appsweb.com\/wp-content\/uploads\/2023\/03\/beforeafter.png 1728w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><br \/>\n\u3053\u306e<span>\u7591\u4f3c\u8981\u7d20<\/span>\u3092\u4f7f\u3044\u3001&#8221;<span style=\"background-color: lightgray;\">border: 15px solid transparent;<\/span>&#8220;\u3068&#8221;<span style=\"background-color: lightgray;\">border-left: 25px solid #e0ffe0;<\/span>&#8220;\u3067\u5439\u304d\u51fa\u3057\u306e\u4e09\u89d2\u5f62\u3092\u4f5c\u6210\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n\u307e\u305a\u3001&#8221;<span style=\"background-color: lightgray;\">border: 15px solid transparent;<\/span>&#8220;\u306715px\u5e73\u65b9\u306e\u900f\u660e\u306a\u6b63\u65b9\u5f62\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\u3053\u306e\u3068\u304d\u7591\u4f3c\u8981\u7d20\u306f\u3053\u306e\u6b63\u65b9\u5f62\u306e\u4e2d\u5fc3\u304c\u7591\u4f3c\u7528\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/trend-appsweb.com\/wp-content\/uploads\/2023\/03\/transparent-1.png\"><img decoding=\"async\" src=\"https:\/\/trend-appsweb.com\/wp-content\/uploads\/2023\/03\/transparent-1.png\" alt=\"\" width=\"212\" height=\"210\" class=\"alignnone wp-image-1715\" srcset=\"https:\/\/trend-appsweb.com\/wp-content\/uploads\/2023\/03\/transparent-1.png 495w, https:\/\/trend-appsweb.com\/wp-content\/uploads\/2023\/03\/transparent-1-300x297.png 300w, https:\/\/trend-appsweb.com\/wp-content\/uploads\/2023\/03\/transparent-1-150x150.png 150w\" sizes=\"(max-width: 212px) 100vw, 212px\" \/><\/a><\/p>\n<p>\u6b21\u306b\u3001&#8221;<span style=\"background-color: lightgray;\">border-left: 25px solid #e0ffe0;<\/span>&#8220;\u3067\u7591\u4f3c\u8981\u7d20\u306e\u5de6\u507425px\u306e\u3068\u3053\u308d\u306b\u7dda\u3092\u5f15\u304d\u3001#e0ffe0\u3067\u5857\u308a\u3064\u3076\u3059\u3053\u3068\u3067\u4e09\u89d2\u5f62\u3092\u4f5c\u3063\u3066\u8a00\u3044\u307e\u3059\u3002<br \/>\n\u6700\u521d\u306b\u8a2d\u5b9a\u3057\u305f\u3001\u900f\u660e\u306a\u6b63\u65b9\u5f62\u306e15px\u304c\u5b8c\u6210\u3057\u305f\u4e09\u89d2\u5f62\u306e\u5e95\u8fba\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/trend-appsweb.com\/wp-content\/uploads\/2023\/03\/hukidashi.png\"><img decoding=\"async\" src=\"https:\/\/trend-appsweb.com\/wp-content\/uploads\/2023\/03\/hukidashi-1024x317.png\" alt=\"\" width=\"1024\" height=\"317\" class=\"alignnone size-large wp-image-1718\" srcset=\"https:\/\/trend-appsweb.com\/wp-content\/uploads\/2023\/03\/hukidashi-1024x317.png 1024w, https:\/\/trend-appsweb.com\/wp-content\/uploads\/2023\/03\/hukidashi-300x93.png 300w, https:\/\/trend-appsweb.com\/wp-content\/uploads\/2023\/03\/hukidashi-768x238.png 768w, https:\/\/trend-appsweb.com\/wp-content\/uploads\/2023\/03\/hukidashi-1536x476.png 1536w, https:\/\/trend-appsweb.com\/wp-content\/uploads\/2023\/03\/hukidashi.png 1886w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p><span>\u5c11\u3057\u8907\u96d1\u3067\u5206\u304b\u308a\u306b\u304f\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u304c\u3001\u5439\u304d\u51fa\u3057\u306e\u4e09\u89d2\u5f62\u306e\u90e8\u5206\u4f5c\u308b\u305f\u3081\u306b\u3044\u304f\u3064\u304b\u306e\u6280\u5de7\u3092\u99c6\u4f7f\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u4ed6\u306b\u3082&#8221;clip-path&#8221;\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u4f7f\u7528\u3057\u3066\u3001\u30dd\u30ea\u30b4\u30f3\u3092\u5b9a\u7fa9\u3057\u3066\u5439\u304d\u51fa\u3057\u3092\u4f5c\u308b\u65b9\u6cd5\u306a\u3069\u3082\u3042\u308a\u307e\u3059\u3002<br \/>\n<\/span><\/p>\n<h4 class=\"tejun\">\u2466JavaScript\u90e8\u5206\u306e\u4f5c\u6210<\/h4>\n<p>showchat.blade.php\u306b\u306e&lt;script type=&#8221;text\/javascript&#8221;&gt;\u306e\u4e2d\u306b\u3001\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u306b\u30d5\u30a9\u30fc\u30e0\u30c7\u30fc\u30bf\u3092\u9001\u4fe1\u3059\u308b\u90e8\u5206\u3068\u3001\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u304b\u3089\u9001\u4fe1\u3055\u308c\u305fJSON\u3092\u53d7\u3051\u53d6\u308b\u90e8\u5206\u3092JavaScript\u3067\u4f5c\u6210\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p class=\"file_name\"><em>resources\/views\/chats\/showchat.blade.php(JavaScript\u90e8)<\/em><\/p>\n<div class=\"hcb_wrap\" style=\"margin: 0;\">\n<pre class=\"prism line-numbers lang-js\" data-lang=\"JavaScript\"><code>&lt;script type=\"text\/javascript\"&gt;\r\n    function new_message1() {\r\n        var form = document.getElementById(\"send_message_form1\");\r\n\r\n        var formData = new FormData(form);\r\n        formData.append(\"_token\", document.querySelector('meta[name=\"csrf-token\"]').getAttribute('content'));\r\n\r\n        fetch('{{ route('chats.store') }}', {\r\n            method: 'POST',\r\n            headers: {'X-CSRF-TOKEN': document.querySelector('meta[name=\"csrf-token\"]').getAttribute('content')},\r\n            body: formData\r\n        })\r\n        .then(response =&gt; response.json())\r\n        .then(data =&gt; {\r\n            \/\/\u30c6\u30ad\u30b9\u30c8\u30a8\u30ea\u30a2\u306e\u30af\u30ea\u30a2\r\n            var textarea = document.querySelector(\"#send_message_form1 &gt; textarea\")\r\n            textarea.value = \"\";\r\n\r\n            \/\/\u30b3\u30f3\u30bd\u30fc\u30eb\u306b\u300c\u9001\u4fe1\u5b8c\u4e86\u300d\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u8868\u793a\r\n            console.log(data.done);\r\n        })\r\n        .catch(error =&gt; {\r\n            console.error('Error:', error);\r\n        });\r\n    }\r\n\r\n    function new_message2() {\r\n        var form = document.getElementById(\"send_message_form2\");\r\n\r\n        var formData = new FormData(form);\r\n        formData.append(\"_token\", document.querySelector('meta[name=\"csrf-token\"]').getAttribute('content'));\r\n\r\n        fetch('{{ route('chats.store') }}', {\r\n            method: 'POST',\r\n            headers: {'X-CSRF-TOKEN': document.querySelector('meta[name=\"csrf-token\"]').getAttribute('content')},\r\n            body: formData\r\n        })\r\n        .then(response =&gt; response.json())\r\n        .then(data =&gt; {\r\n            \/\/\u30c6\u30ad\u30b9\u30c8\u30a8\u30ea\u30a2\u306e\u30af\u30ea\u30a2\r\n            var textarea = document.querySelector(\"#send_message_form2 &gt; textarea\")\r\n            textarea.value = \"\";\r\n\r\n            \/\/\u30b3\u30f3\u30bd\u30fc\u30eb\u306b\u300c\u9001\u4fe1\u5b8c\u4e86\u300d\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u8868\u793a\r\n            console.log(data.done);\r\n        })\r\n        .catch(error =&gt; {\r\n            console.error('Error:', error);\r\n        });\r\n    }\r\n&lt;\/script&gt;<\/code><\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<p>\u4e0a\u8a18\u30b3\u30fc\u30c9\u3067\u306ffetch\u3068\u3044\u3046\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3063\u3066\u3001\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u306b\u30d5\u30a9\u30fc\u30e0\u306e\u5185\u5bb9\u3092POST\u9001\u4fe1\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>Laravel\u3067\u306f\u3001\u30ea\u30af\u30a8\u30b9\u30c8\u306b\u542b\u307e\u308c\u308b\u7279\u5225\u306a\u30c8\u30fc\u30af\u30f3\u3092\u691c\u8a3c\u3059\u308b\u3053\u3068\u3067\u3001\u30af\u30ed\u30b9\u30b5\u30a4\u30c8\u30ea\u30af\u30a8\u30b9\u30c8\u30d5\u30a9\u30fc\u30b8\u30a7\u30ea(CSRF)\u653b\u6483\u3092\u9632\u6b62\u3057\u307e\u3059\u3002<span>CSRF\u653b\u6483\u3068\u306f\u3001\u81ea\u5206\u306e\u30b5\u30a4\u30c8\u3068\u306f\u95a2\u4fc2\u306e\u306a\u3044\u5225\u306e\u30b5\u30a4\u30c8\u304b\u3089\u3001\u8aa4\u3063\u3066\u30d5\u30a9\u30fc\u30e0\u9001\u4fe1\u3055\u308c\u3066\u3057\u307e\u3063\u305f\u308a\u3001\u60aa\u610f\u3092\u6301\u3063\u305f\u30e6\u30fc\u30b6\u30fc\u306b\u3088\u3063\u3066\u5225\u30b5\u30a4\u30c8\u304b\u3089\u30d5\u30a9\u30fc\u30e0\u9001\u4fe1\u3055\u308c\u3066\u3057\u307e\u3046\u3053\u3068\u3067\u3059\u3002<\/span><\/p>\n<p><span>\u30c8\u30fc\u30af\u30f3\u3068\u306f\u3001\u30e9\u30f3\u30c0\u30e0\u306a\u6587\u5b57\u5217\u3067\u751f\u6210\u3055\u308c\u305f\u3001\u30d5\u30a9\u30fc\u30e0\u9001\u4fe1\u5143\u3092\u7279\u5b9a\u3059\u308b\u305f\u3081\u306e\u79d8\u5bc6\u306e\u5024\u3067\u3059\u3002\u3053\u306e\u30c8\u30fc\u30af\u30f3\u3092\u691c\u8a3c\u3057\u3066\u554f\u984c\u304c\u306a\u3051\u308c\u3070\u3001\u30d5\u30a9\u30fc\u30e0\u9001\u4fe1\u304c\u53d7\u7406\u3055\u308c\u307e\u3059\u3002<\/span><\/p>\n<p>&#8220;<span style=\"background-color: lightgray;\">formData.append(&#8220;_token&#8221;, document.querySelector(&#8216;meta[name=&#8221;csrf-token&#8221;]&#8217;).getAttribute(&#8216;content&#8217;));<\/span>&#8220;\u3068&#8221;<span style=\"background-color: lightgray;\">fheaders: {&#8216;X-CSRF-TOKEN&#8217;: document.querySelector(&#8216;meta[name=&#8221;csrf-token&#8221;]&#8217;).getAttribute(&#8216;content&#8217;)},<\/span>&#8220;\u306e\u90e8\u5206\u306f\u3001<span>\u30d5\u30a9\u30fc\u30e0\u30c7\u30fc\u30bf\u306b\u542b\u307e\u308c\u308b\u30c8\u30fc\u30af\u30f3\u3068\u3001fetch\u30e1\u30bd\u30c3\u30c9\u306e\u30d8\u30c3\u30c0\u30fc\u306b\u542b\u307e\u308c\u308b\u30c8\u30fc\u30af\u30f3\u306e2\u3064\u3092\u8a2d\u5b9a\u3057\u3066\u3044\u308b\u3068\u3053\u308d\u3067\u3059\u3002<br \/>\n<\/span>\u306a\u304a\u3001\u3053\u306e\u30b3\u30fc\u30c9\u3092\u6709\u52b9\u306b\u3059\u308b\u305f\u3081\u306b\u306f\u30d3\u30e5\u30fc\u3082\u3057\u304f\u306f\u30ec\u30a4\u30a2\u30a6\u30c8\u30d5\u30a1\u30a4\u30eb\u306e\u30d8\u30c3\u30c9\u306b<code>\"<span style=\"background-color: lightgray;\">&lt;meta name=\"csrf-token\" content=\"{{ csrf_token() }}\"&gt;<\/span>\"<\/code>\u3092\u66f8\u304d\u5fd8\u308c\u306a\u3044\u3088\u3046\u306b\u3054\u6ce8\u610f\u4e0b\u3055\u3044\u3002<\/p>\n<p><span>\u307e\u305f\u3001<\/span>\u30d5\u30a9\u30fc\u30e0\u30c7\u30fc\u30bf\u3092\u9001\u4fe1\u3057\u305f\u5f8c\u306b&#8221;<span style=\"background-color: lightgray;\">.then(response =&gt; response.json())<\/span>&#8220;\u3068&#8221;<span style=\"background-color: lightgray;\">.then(data =&gt; {\u00a0 <\/span>&#8220;\u3067<span>\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u304b\u3089\u6e21\u3055\u308c\u305f$param\u3092\u53d7\u3051\u53d6\u308a\u3001JavaScript\u4e0a\u306e\u5909\u6570\u540d\u300cdata\u300d\u3068\u3057\u3066\u6271\u3063\u3066\u3044\u307e\u3059\u3002<\/span><\/p>\n<h3 class=\"midashi\">\u5b8c\u6210\u56f3<\/h3>\n<p>\u4e0a\u8a18\u624b\u9806\u306b\u3066\u3001\u4e0b\u56f3\u306e\u3088\u3046\u306a\u753b\u9762\u304c\u4f5c\u6210\u3055\u308c\u307e\u3057\u305f\u3002\u5f15\u304d\u7d9a\u304d\u300c<a href=\"https:\/\/trend-appsweb.com\/myportfolio\/?p=1733\">Laravel+JavaScript\u3067\u975e\u540c\u671f\u578b\u306e\u3067\u30c1\u30e3\u30c3\u30c8\u3092\u4f5c\u3063\u3066\u307f\u308b\u2461<\/a>\u300d\u306b\u3066\u975e\u540c\u671f\u3067\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u306b\u30c1\u30e3\u30c3\u30c8\u753b\u9762\u3092\u66f4\u65b0\u3059\u308b\u90e8\u5206\u3092\u4f5c\u6210\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<div style=\"width: 571px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-1668-2\" width=\"571\" height=\"419\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/trend-appsweb.com\/wp-content\/uploads\/2023\/03\/20230323_164411.mp4?_=2\" \/><a href=\"https:\/\/trend-appsweb.com\/wp-content\/uploads\/2023\/03\/20230323_164411.mp4\">https:\/\/trend-appsweb.com\/wp-content\/uploads\/2023\/03\/20230323_164411.mp4<\/a><\/video><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u30c6\u30fc\u30de \u3053\u3093\u306b\u3061\u306f\uff01naoto555\u3067\u3059\u3002 \u4eca\u56de\u306f\u3001Laravel+JavaScript\u3067\u975e\u540c\u671f\u578b\u306e\u30c1\u30e3\u30c3\u30c8\u3092\u4f5c\u6210\u3059\u308b\u65b9\u6cd5\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002 \u30c1\u30e3\u30c3\u30c8\u30a2\u30d7\u30ea\u306f\u3001Web\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306b\u6b20\u304b\u305b\u306a\u3044\u6a5f\u80fd\u306e1\u3064\u3067\u3001\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u3067 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}},"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[13],"tags":[],"class_list":["post-1668","post","type-post","status-publish","format-standard","hentry","category-laravelphp"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/trend-appsweb.com\/myportfolio\/index.php?rest_route=\/wp\/v2\/posts\/1668","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/trend-appsweb.com\/myportfolio\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/trend-appsweb.com\/myportfolio\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/trend-appsweb.com\/myportfolio\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/trend-appsweb.com\/myportfolio\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1668"}],"version-history":[{"count":62,"href":"https:\/\/trend-appsweb.com\/myportfolio\/index.php?rest_route=\/wp\/v2\/posts\/1668\/revisions"}],"predecessor-version":[{"id":1784,"href":"https:\/\/trend-appsweb.com\/myportfolio\/index.php?rest_route=\/wp\/v2\/posts\/1668\/revisions\/1784"}],"wp:attachment":[{"href":"https:\/\/trend-appsweb.com\/myportfolio\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1668"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/trend-appsweb.com\/myportfolio\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1668"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/trend-appsweb.com\/myportfolio\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1668"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}