{"id":2494,"date":"2025-03-24T08:47:10","date_gmt":"2025-03-23T23:47:10","guid":{"rendered":"https:\/\/dexall.co.jp\/articles\/?p=2494"},"modified":"2025-03-24T08:47:40","modified_gmt":"2025-03-23T23:47:40","slug":"%e3%80%90%e4%bf%9d%e5%ae%88%e6%80%a7%e6%8a%9c%e7%be%a4%e3%80%91laravel%e3%81%aeajax%e5%ae%9f%e8%a3%85%e5%ae%8c%e5%85%a8%e3%82%ac%e3%82%a4%e3%83%89-5%e3%81%a4%e3%81%ae%e5%ae%9f%e8%b7%b5%e7%9a%84","status":"publish","type":"post","link":"https:\/\/dexall.co.jp\/articles\/?p=2494","title":{"rendered":"\u3010\u4fdd\u5b88\u6027\u629c\u7fa4\u3011Laravel\u306eAjax\u5b9f\u88c5\u5b8c\u5168\u30ac\u30a4\u30c9 &#8211; 5\u3064\u306e\u5b9f\u8df5\u7684\u306a\u30b3\u30fc\u30c9\u4f8b\u4ed8\u304d"},"content":{"rendered":"\n<div class=\"toc\"><br \/>\n<b>Warning<\/b>:  Undefined array key \"is_admin\" in <b>\/home\/xs392991\/dexall.co.jp\/public_html\/articles\/wp-content\/themes\/sango-theme\/library\/gutenberg\/dist\/classes\/Toc.php<\/b> on line <b>116<\/b><br \/>\n<br \/>\n<b>Warning<\/b>:  Undefined array key \"is_category_top\" in <b>\/home\/xs392991\/dexall.co.jp\/public_html\/articles\/wp-content\/themes\/sango-theme\/library\/gutenberg\/dist\/classes\/Toc.php<\/b> on line <b>121<\/b><br \/>\n<br \/>\n<b>Warning<\/b>:  Undefined array key \"is_top\" in <b>\/home\/xs392991\/dexall.co.jp\/public_html\/articles\/wp-content\/themes\/sango-theme\/library\/gutenberg\/dist\/classes\/Toc.php<\/b> on line <b>128<\/b><br \/>\n    <div id=\"toc_container\" class=\"sgb-toc--bullets js-smooth-scroll\" data-dialog-title=\"\u76ee\u6b21\">\n      <p class=\"toc_title\">\u76ee\u6b21 <\/p>\n      <ul class=\"toc_list\">  <li class=\"first\">    <a href=\"#i-0\">Laravel\u3067\u306eAjax\u5b9f\u88c5\u306e\u57fa\u790e\u77e5\u8b58<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-1\">Ajax\u3068Laravel\u306e\u76f8\u6027\u304c\u629c\u7fa4\u306a\u7406\u7531<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-2\">\u5b9f\u88c5\u524d\u306b\u62bc\u3055\u3048\u3066\u304a\u304d\u305f\u3044\u91cd\u8981\u306a\u6982\u5ff5<\/a>      <\/li>    <\/ul>  <\/li>  <li>    <a href=\"#i-6\">Laravel\u00d7Ajax\u306e\u57fa\u672c\u7684\u306a\u5b9f\u88c5\u624b\u9806<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-7\">\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u306e\u6b63\u3057\u3044\u8a2d\u5b9a\u65b9\u6cd5<\/a>      <\/li>      <li>        <a href=\"#i-8\">\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3067\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u51e6\u7406\u306e\u66f8\u304d\u65b9<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-9\">\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u3067\u306eAjax\u547c\u3073\u51fa\u3057\u306e\u5b9f\u88c5<\/a>      <\/li>    <\/ul>  <\/li>  <li>    <a href=\"#i-10\">\u5b9f\u8df5\u3067\u4f7f\u3048\u308b5\u3064\u306eAjax\u5b9f\u88c5\u4f8b<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-11\">\u975e\u540c\u671f\u3067\u306e\u30d5\u30a9\u30fc\u30e0\u30c7\u30fc\u30bf\u9001\u4fe1<\/a>      <\/li>      <li>        <a href=\"#i-12\">\u52d5\u7684\u306a\u30c6\u30fc\u30d6\u30eb\u66f4\u65b0\u306e\u5b9f\u88c5<\/a>      <\/li>      <li>        <a href=\"#i-13\">\u30d5\u30a1\u30a4\u30eb\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u306e\u975e\u540c\u671f\u51e6\u7406<\/a>      <\/li>      <li>        <a href=\"#i-14\">\u691c\u7d22\u6a5f\u80fd\u306e\u5b9f\u88c5\u3068\u30ad\u30e3\u30c3\u30b7\u30e5\u5236\u5fa1<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-15\">\u7121\u9650\u30b9\u30af\u30ed\u30fc\u30eb\u306e\u5b9f\u88c5\u65b9\u6cd5<\/a>      <\/li>    <\/ul>  <\/li>  <li>    <a href=\"#i-16\">Ajax\u5b9f\u88c5\u6642\u306e\u91cd\u8981\u306a\u6ce8\u610f\u70b9\u3068\u5bfe\u7b56<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-17\">CSRF\u30c8\u30fc\u30af\u30f3\u5bfe\u7b56\u306e\u5b9f\u88c5\u65b9\u6cd5<\/a>      <\/li>      <li>        <a href=\"#i-21\">\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u30a8\u30e9\u30fc\u306e\u9069\u5207\u306a\u51e6\u7406<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-22\">\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30ea\u30b9\u30af\u3068\u305d\u306e\u5bfe\u51e6\u6cd5<\/a>      <\/li>    <\/ul>  <\/li>  <li class=\"last\">    <a href=\"#i-27\">\u4fdd\u5b88\u6027\u3092\u9ad8\u3081\u308b\u305f\u3081\u306e\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-28\">\u30b3\u30fc\u30c9\u306e\u5206\u5272\u3068\u518d\u5229\u7528\u53ef\u80fd\u306a\u8a2d\u8a08<\/a>      <\/li>      <li>        <a href=\"#i-31\">\u52b9\u679c\u7684\u306a\u30a8\u30e9\u30fc\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0\u306e\u5b9f\u88c5<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-34\">\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9\u306e\u66f8\u304d\u65b9\u3068\u5b9f\u884c\u65b9\u6cd5<\/a>      <\/li>    <\/ul>  <\/li><\/ul>\n      <a href=\"#\" class=\"sgb-toc-button js-toc-button\" rel=\"nofollow\" data-open-dialog=\"true\"><i class=\"fa fa-list\"><\/i><span class=\"sgb-toc-button__text\">\u76ee\u6b21\u3078<\/span><\/a>\n    <\/div><\/div><h2 class=\"wp-block-heading\" id=\"i-0\">Laravel\u3067\u306eAjax\u5b9f\u88c5\u306e\u57fa\u790e\u77e5\u8b58<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-1\">Ajax\u3068Laravel\u306e\u76f8\u6027\u304c\u629c\u7fa4\u306a\u7406\u7531<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Laravel\u3068Ajax\u306e\u7d44\u307f\u5408\u308f\u305b\u304c\u591a\u304f\u306e\u958b\u767a\u8005\u306b\u652f\u6301\u3055\u308c\u308b\u7406\u7531\u306f\u3001\u4ee5\u4e0b\u306e3\u3064\u306e\u7279\u5fb4\u306b\u96c6\u7d04\u3055\u308c\u307e\u3059\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u7d71\u5408\u3055\u308c\u305f\u975e\u540c\u671f\u51e6\u7406\u306e\u4ed5\u7d44\u307f<\/strong><\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Laravel\u306e\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u30b7\u30b9\u30c6\u30e0\u304cRESTful API\u306b\u6700\u9069\u5316\u3055\u308c\u3066\u3044\u308b<\/li>\n\n\n\n<li>\u30d5\u30a9\u30fc\u30e0\u30ea\u30af\u30a8\u30b9\u30c8\u306b\u3088\u308b\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u6a5f\u80fd\u304c\u5145\u5b9f<\/li>\n\n\n\n<li>JSON\u30ec\u30b9\u30dd\u30f3\u30b9\u306e\u751f\u6210\u304c\u7c21\u5358\u3067\u76f4\u611f\u7684<\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u5145\u5b9f\u3057\u305f\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u6a5f\u80fd<\/strong><\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>CSRF\u30c8\u30fc\u30af\u30f3\u306e\u81ea\u52d5\u751f\u6210\u3068\u691c\u8a3c<\/li>\n\n\n\n<li>XSS\u5bfe\u7b56\u304c\u6a19\u6e96\u3067\u5b9f\u88c5<\/li>\n\n\n\n<li>\u30bb\u30c3\u30b7\u30e7\u30f3\u7ba1\u7406\u304c\u5805\u7262<\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u958b\u767a\u52b9\u7387\u3092\u9ad8\u3081\u308b\u8c4a\u5bcc\u306a\u6a5f\u80fd<\/strong><\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Blade\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3068\u306e\u9023\u643a\u304c\u5bb9\u6613<\/li>\n\n\n\n<li>Eloquent ORM\u306b\u3088\u308b\u30c7\u30fc\u30bf\u64cd\u4f5c\u304c\u76f4\u611f\u7684<\/li>\n\n\n\n<li>\u30ad\u30e3\u30c3\u30b7\u30e5\u5236\u5fa1\u304c\u67d4\u8edf<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-2\">\u5b9f\u88c5\u524d\u306b\u62bc\u3055\u3048\u3066\u304a\u304d\u305f\u3044\u91cd\u8981\u306a\u6982\u5ff5<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-3\">1. \u975e\u540c\u671f\u901a\u4fe1\u306e\u57fa\u672c\u539f\u5247<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">\u975e\u540c\u671f\u901a\u4fe1\u3067\u306f\u3001\u4ee5\u4e0b\u306e\u70b9\u3092\u5e38\u306b\u610f\u8b58\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u30ea\u30af\u30a8\u30b9\u30c8\u3068\u30ec\u30b9\u30dd\u30f3\u30b9\u306e\u5206\u96e2<\/strong><\/li>\n\n\n\n<li>\u30e1\u30a4\u30f3\u30b9\u30ec\u30c3\u30c9\u3092\u30d6\u30ed\u30c3\u30af\u3057\u306a\u3044<\/li>\n\n\n\n<li>\u30e6\u30fc\u30b6\u30fc\u4f53\u9a13\u3092\u640d\u306a\u308f\u306a\u3044\u51e6\u7406\u8a2d\u8a08<\/li>\n\n\n\n<li>\u30a8\u30e9\u30fc\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0\u306e\u91cd\u8981\u6027<\/li>\n\n\n\n<li><strong>\u72b6\u614b\u7ba1\u7406\u306e\u6ce8\u610f\u70b9<\/strong><\/li>\n\n\n\n<li>\u901a\u4fe1\u4e2d\u306e\u72b6\u614b\u8868\u793a<\/li>\n\n\n\n<li>\u5b8c\u4e86\u5f8c\u306e\u753b\u9762\u66f4\u65b0<\/li>\n\n\n\n<li>\u30a8\u30e9\u30fc\u6642\u306e\u30d5\u30a9\u30fc\u30eb\u30d0\u30c3\u30af<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-4\">2. Laravel\u3067\u306eAjax\u5b9f\u88c5\u306b\u95a2\u3059\u308b\u91cd\u8981\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ routes\/web.php\nRoute::post('\/api\/users', [UserController::class, 'store'])-&gt;name('users.store');\nRoute::get('\/api\/users', [UserController::class, 'index'])-&gt;name('users.index');<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ app\/Http\/Controllers\/UserController.php\npublic function store(Request $request)\n{\n    $validated = $request-&gt;validate([\n        'name' =&gt; 'required|string|max:255',\n        'email' =&gt; 'required|email|unique:users',\n    ]);\n\n    $user = User::create($validated);\n\n    return response()-&gt;json([\n        'success' =&gt; true,\n        'data' =&gt; $user\n    ]);\n}<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ resources\/js\/app.js\n$.ajax({\n    url: '\/api\/users',\n    method: 'POST',\n    data: {\n        name: 'John Doe',\n        email: 'john@example.com',\n        _token: '{{ csrf_token() }}'  \/\/ CSRF\u30c8\u30fc\u30af\u30f3\u306e\u9001\u4fe1\n    },\n    success: function(response) {\n        console.log('\u30e6\u30fc\u30b6\u30fc\u304c\u4f5c\u6210\u3055\u308c\u307e\u3057\u305f:', response.data);\n    },\n    error: function(xhr) {\n        console.error('\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f:', xhr.responseJSON);\n    }\n});<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-5\">3. \u91cd\u8981\u306a\u8a2d\u8a08\u539f\u5247<\/h4>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u8cac\u4efb\u306e\u5206\u96e2<\/strong><\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u3068\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u306e\u5f79\u5272\u3092\u660e\u78ba\u306b<\/li>\n\n\n\n<li>\u30d3\u30b8\u30cd\u30b9\u30ed\u30b8\u30c3\u30af\u3068\u30d7\u30ec\u30bc\u30f3\u30c6\u30fc\u30b7\u30e7\u30f3\u30ed\u30b8\u30c3\u30af\u306e\u5206\u96e2<\/li>\n\n\n\n<li>\u518d\u5229\u7528\u53ef\u80fd\u306a\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u8a2d\u8a08<\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u30a8\u30e9\u30fc\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0<\/strong><\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u30a8\u30e9\u30fc\u306e\u9069\u5207\u306a\u51e6\u7406<\/li>\n\n\n\n<li>\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a8\u30e9\u30fc\u3078\u306e\u5bfe\u5fdc<\/li>\n\n\n\n<li>\u30e6\u30fc\u30b6\u30fc\u3078\u306e\u30d5\u30a3\u30fc\u30c9\u30d0\u30c3\u30af\u65b9\u6cd5<\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u8003\u616e<\/strong><\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5fc5\u8981\u6700\u5c0f\u9650\u306e\u30c7\u30fc\u30bf\u901a\u4fe1<\/li>\n\n\n\n<li>\u9069\u5207\u306a\u30ad\u30e3\u30c3\u30b7\u30e5\u6226\u7565<\/li>\n\n\n\n<li>\u52b9\u7387\u7684\u306a\u30af\u30a8\u30ea\u8a2d\u8a08<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u306e\u57fa\u790e\u77e5\u8b58\u3092\u62bc\u3055\u3048\u308b\u3053\u3068\u3067\u3001\u4ee5\u964d\u306e\u5b9f\u88c5\u304c\u30b9\u30e0\u30fc\u30ba\u306b\u306a\u308a\u3001\u4fdd\u5b88\u6027\u306e\u9ad8\u3044\u30b3\u30fc\u30c9\u304c\u66f8\u3051\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002\u6b21\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001\u3053\u308c\u3089\u306e\u6982\u5ff5\u3092\u6d3b\u7528\u3057\u305f\u5177\u4f53\u7684\u306a\u5b9f\u88c5\u624b\u9806\u3092\u898b\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-6\">Laravel\u00d7Ajax\u306e\u57fa\u672c\u7684\u306a\u5b9f\u88c5\u624b\u9806<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-7\">\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u306e\u6b63\u3057\u3044\u8a2d\u5b9a\u65b9\u6cd5<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Laravel\u3067Ajax\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u51e6\u7406\u3059\u308b\u305f\u3081\u306e\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u8a2d\u5b9a\u306f\u3001API\u306e\u8a2d\u8a08\u539f\u5247\u306b\u5f93\u3063\u3066\u884c\u3046\u3053\u3068\u304c\u91cd\u8981\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ routes\/web.php\nRoute::prefix('api')-&gt;group(function () {\n    \/\/ \u30ea\u30bd\u30fc\u30b9\u306e\u4e00\u89a7\u53d6\u5f97\n    Route::get('\/items', [ItemController::class, 'index'])-&gt;name('items.index');\n\n    \/\/ \u30ea\u30bd\u30fc\u30b9\u306e\u65b0\u898f\u4f5c\u6210\n    Route::post('\/items', [ItemController::class, 'store'])-&gt;name('items.store');\n\n    \/\/ \u30ea\u30bd\u30fc\u30b9\u306e\u66f4\u65b0\n    Route::put('\/items\/{item}', [ItemController::class, 'update'])-&gt;name('items.update');\n\n    \/\/ \u30ea\u30bd\u30fc\u30b9\u306e\u524a\u9664\n    Route::delete('\/items\/{item}', [ItemController::class, 'destroy'])-&gt;name('items.destroy');\n});\n\n\/\/ \u307e\u305f\u306f\u3001\u30ea\u30bd\u30fc\u30b9\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\nRoute::apiResource('items', ItemController::class);<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u91cd\u8981\u306a\u30dd\u30a4\u30f3\u30c8\uff1a<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>API\u30a8\u30f3\u30c9\u30dd\u30a4\u30f3\u30c8\u306f <code>\/api<\/code> \u30d7\u30ec\u30d5\u30a3\u30c3\u30af\u30b9\u3092\u4ed8\u3051\u3066\u5206\u96e2<\/li>\n\n\n\n<li>RESTful \u306a\u547d\u540d\u898f\u5247\u306e\u63a1\u7528<\/li>\n\n\n\n<li>\u30df\u30c9\u30eb\u30a6\u30a7\u30a2\u30b0\u30eb\u30fc\u30d7\u306e\u9069\u5207\u306a\u8a2d\u5b9a<\/li>\n\n\n\n<li>\u540d\u524d\u4ed8\u304d\u30eb\u30fc\u30c8\u306e\u6d3b\u7528<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-8\">\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3067\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u51e6\u7406\u306e\u66f8\u304d\u65b9<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3067\u306f\u3001\u30ea\u30af\u30a8\u30b9\u30c8\u306e\u691c\u8a3c\u304b\u3089\u30ec\u30b9\u30dd\u30f3\u30b9\u306e\u8fd4\u5374\u307e\u3067\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u6d41\u308c\u3067\u5b9f\u88c5\u3057\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ app\/Http\/Controllers\/ItemController.php\nclass ItemController extends Controller\n{\n    public function store(Request $request)\n    {\n        \/\/ 1. \u30ea\u30af\u30a8\u30b9\u30c8\u306e\u691c\u8a3c\n        $validated = $request-&gt;validate([\n            'name' =&gt; 'required|string|max:255',\n            'price' =&gt; 'required|numeric|min:0',\n            'description' =&gt; 'nullable|string'\n        ]);\n\n        try {\n            \/\/ 2. \u30c7\u30fc\u30bf\u306e\u4fdd\u5b58\n            $item = Item::create($validated);\n\n            \/\/ 3. \u30ec\u30b9\u30dd\u30f3\u30b9\u306e\u8fd4\u5374\n            return response()-&gt;json([\n                'success' =&gt; true,\n                'message' =&gt; '\u5546\u54c1\u304c\u6b63\u5e38\u306b\u4f5c\u6210\u3055\u308c\u307e\u3057\u305f',\n                'data' =&gt; $item\n            ], 201);\n\n        } catch (\\Exception $e) {\n            \/\/ 4. \u30a8\u30e9\u30fc\u51e6\u7406\n            return response()-&gt;json([\n                'success' =&gt; false,\n                'message' =&gt; '\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f',\n                'error' =&gt; $e-&gt;getMessage()\n            ], 500);\n        }\n    }\n\n    public function update(Request $request, Item $item)\n    {\n        \/\/ \u30e2\u30c7\u30eb\u30d0\u30a4\u30f3\u30c7\u30a3\u30f3\u30b0\u3092\u6d3b\u7528\u3057\u305f\u66f4\u65b0\u51e6\u7406\n        $validated = $request-&gt;validate([\n            'name' =&gt; 'sometimes|required|string|max:255',\n            'price' =&gt; 'sometimes|required|numeric|min:0',\n            'description' =&gt; 'nullable|string'\n        ]);\n\n        try {\n            $item-&gt;update($validated);\n\n            return response()-&gt;json([\n                'success' =&gt; true,\n                'message' =&gt; '\u5546\u54c1\u304c\u6b63\u5e38\u306b\u66f4\u65b0\u3055\u308c\u307e\u3057\u305f',\n                'data' =&gt; $item-&gt;fresh()\n            ]);\n\n        } catch (\\Exception $e) {\n            return response()-&gt;json([\n                'success' =&gt; false,\n                'message' =&gt; '\u66f4\u65b0\u4e2d\u306b\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f',\n                'error' =&gt; $e-&gt;getMessage()\n            ], 500);\n        }\n    }\n}<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-9\">\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u3067\u306eAjax\u547c\u3073\u51fa\u3057\u306e\u5b9f\u88c5<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u3067\u306f\u3001Ajax\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u52b9\u7387\u7684\u306b\u7ba1\u7406\u3059\u308b\u305f\u3081\u306b\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u5b9f\u88c5\u3092\u63a8\u5968\u3057\u307e\u3059\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ resources\/js\/api\/items.js\n\n\/\/ API\u547c\u3073\u51fa\u3057\u3092\u7ba1\u7406\u3059\u308b\u30af\u30e9\u30b9\nclass ItemsApi {\n    \/\/ \u5546\u54c1\u306e\u65b0\u898f\u4f5c\u6210\n    static async create(itemData) {\n        try {\n            const response = await $.ajax({\n                url: '\/api\/items',\n                method: 'POST',\n                data: {\n                    ...itemData,\n                    _token: document.querySelector('meta[name=\"csrf-token\"]').content\n                }\n            });\n\n            return response;\n\n        } catch (error) {\n            this.handleError(error);\n            throw error;\n        }\n    }\n\n    \/\/ \u30a8\u30e9\u30fc\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0\u5171\u901a\u51e6\u7406\n    static handleError(error) {\n        if (error.status === 422) {\n            \/\/ \u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u30a8\u30e9\u30fc\u306e\u51e6\u7406\n            const errors = error.responseJSON.errors;\n            Object.keys(errors).forEach(field =&gt; {\n                \/\/ \u30a8\u30e9\u30fc\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u8868\u793a\u51e6\u7406\n                this.showFieldError(field, errors[field][0]);\n            });\n        } else {\n            \/\/ \u305d\u306e\u4ed6\u306e\u30a8\u30e9\u30fc\u51e6\u7406\n            console.error('API\u30a8\u30e9\u30fc:', error);\n            alert('\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f\u3002\u3057\u3070\u3089\u304f\u5f85\u3063\u3066\u304b\u3089\u518d\u5ea6\u304a\u8a66\u3057\u304f\u3060\u3055\u3044\u3002');\n        }\n    }\n\n    \/\/ \u30d5\u30a3\u30fc\u30eb\u30c9\u30a8\u30e9\u30fc\u306e\u8868\u793a\n    static showFieldError(field, message) {\n        const errorElement = document.querySelector(`#${field}-error`);\n        if (errorElement) {\n            errorElement.textContent = message;\n            errorElement.classList.remove('hidden');\n        }\n    }\n}\n\n\/\/ \u4f7f\u7528\u4f8b\ndocument.querySelector('#create-item-form').addEventListener('submit', async (e) =&gt; {\n    e.preventDefault();\n\n    const formData = {\n        name: document.querySelector('#item-name').value,\n        price: document.querySelector('#item-price').value,\n        description: document.querySelector('#item-description').value\n    };\n\n    try {\n        const response = await ItemsApi.create(formData);\n\n        if (response.success) {\n            \/\/ \u6210\u529f\u6642\u306e\u51e6\u7406\uff08\u4f8b\uff1a\u5546\u54c1\u30ea\u30b9\u30c8\u306e\u66f4\u65b0\uff09\n            updateItemsList(response.data);\n            showSuccessMessage(response.message);\n        }\n\n    } catch (error) {\n        \/\/ \u30a8\u30e9\u30fc\u6642\u306e\u51e6\u7406\u306fItemsApi.handleError()\u3067\u5bfe\u5fdc\u6e08\u307f\n    }\n});<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u306e\u3088\u3046\u306a\u5b9f\u88c5\u306b\u3088\u308a\u3001\u4ee5\u4e0b\u306e\u5229\u70b9\u304c\u5f97\u3089\u308c\u307e\u3059\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u30b3\u30fc\u30c9\u306e\u6574\u7406\u3068\u518d\u5229\u7528<\/strong><\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>API\u547c\u3073\u51fa\u3057\u306e\u30ed\u30b8\u30c3\u30af\u3092\u96c6\u4e2d\u7ba1\u7406<\/li>\n\n\n\n<li>\u30a8\u30e9\u30fc\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0\u306e\u5171\u901a\u5316<\/li>\n\n\n\n<li>\u30e1\u30f3\u30c6\u30ca\u30f3\u30b9\u6027\u306e\u5411\u4e0a<\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u5805\u7262\u6027\u306e\u78ba\u4fdd<\/strong><\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>CSRF\u30c8\u30fc\u30af\u30f3\u306e\u81ea\u52d5\u4ed8\u4e0e<\/li>\n\n\n\n<li>\u30a8\u30e9\u30fc\u51e6\u7406\u306e\u6a19\u6e96\u5316<\/li>\n\n\n\n<li>\u975e\u540c\u671f\u51e6\u7406\u306e\u9069\u5207\u306a\u7ba1\u7406<\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u62e1\u5f35\u6027\u306e\u78ba\u4fdd<\/strong><\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u65b0\u3057\u3044API\u30a8\u30f3\u30c9\u30dd\u30a4\u30f3\u30c8\u306e\u8ffd\u52a0\u304c\u5bb9\u6613<\/li>\n\n\n\n<li>\u30ec\u30b9\u30dd\u30f3\u30b9\u5f62\u5f0f\u306e\u7d71\u4e00<\/li>\n\n\n\n<li>\u30c6\u30b9\u30c8\u306e\u66f8\u304d\u3084\u3059\u3055<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u6b21\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001\u3053\u308c\u3089\u306e\u57fa\u672c\u5b9f\u88c5\u3092\u5fdc\u7528\u3057\u305f\u3001\u3088\u308a\u5b9f\u8df5\u7684\u306a\u5b9f\u88c5\u4f8b\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-10\">\u5b9f\u8df5\u3067\u4f7f\u3048\u308b5\u3064\u306eAjax\u5b9f\u88c5\u4f8b<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-11\">\u975e\u540c\u671f\u3067\u306e\u30d5\u30a9\u30fc\u30e0\u30c7\u30fc\u30bf\u9001\u4fe1<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u30d5\u30a9\u30fc\u30e0\u306e\u9001\u4fe1\u3092Ajax\u3067\u51e6\u7406\u3059\u308b\u5b9f\u88c5\u4f8b\u3067\u3059\u3002\u30e6\u30fc\u30b6\u30fc\u4f53\u9a13\u3092\u5411\u4e0a\u3055\u305b\u3064\u3064\u3001\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u30a8\u30e9\u30fc\u3082\u9069\u5207\u306b\u51e6\u7406\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ app\/Http\/Controllers\/ContactController.php\npublic function store(Request $request)\n{\n    $validated = $request-&gt;validate([\n        'name' =&gt; 'required|string|max:255',\n        'email' =&gt; 'required|email',\n        'message' =&gt; 'required|string|min:10'\n    ]);\n\n    \/\/ \u30e1\u30fc\u30eb\u9001\u4fe1\u51e6\u7406\n    Mail::to('admin@example.com')-&gt;send(new ContactMail($validated));\n\n    return response()-&gt;json([\n        'success' =&gt; true,\n        'message' =&gt; '\u304a\u554f\u3044\u5408\u308f\u305b\u3092\u53d7\u3051\u4ed8\u3051\u307e\u3057\u305f'\n    ]);\n}<\/pre>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ resources\/js\/contact-form.js\nclass ContactForm {\n    constructor(formSelector) {\n        this.form = document.querySelector(formSelector);\n        this.submitButton = this.form.querySelector('button[type=\"submit\"]');\n        this.initializeForm();\n    }\n\n    initializeForm() {\n        this.form.addEventListener('submit', async (e) =&gt; {\n            e.preventDefault();\n            await this.handleSubmit();\n        });\n    }\n\n    async handleSubmit() {\n        this.setLoading(true);\n        const formData = new FormData(this.form);\n\n        try {\n            const response = await $.ajax({\n                url: this.form.action,\n                method: 'POST',\n                data: formData,\n                processData: false,\n                contentType: false\n            });\n\n            if (response.success) {\n                this.showSuccess(response.message);\n                this.resetForm();\n            }\n\n        } catch (error) {\n            this.handleError(error);\n        } finally {\n            this.setLoading(false);\n        }\n    }\n\n    setLoading(isLoading) {\n        this.submitButton.disabled = isLoading;\n        this.submitButton.innerHTML = isLoading ? \n            '&lt;span class=\"spinner\"&gt;&lt;\/span&gt; \u9001\u4fe1\u4e2d...' : \n            '\u9001\u4fe1\u3059\u308b';\n    }\n\n    \/\/ ... \u305d\u306e\u4ed6\u306e\u30e1\u30bd\u30c3\u30c9\n}\n\nnew ContactForm('#contact-form');<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-12\">\u52d5\u7684\u306a\u30c6\u30fc\u30d6\u30eb\u66f4\u65b0\u306e\u5b9f\u88c5<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u30c6\u30fc\u30d6\u30eb\u306e\u30c7\u30fc\u30bf\u3092\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u3067\u66f4\u65b0\u3059\u308b\u5b9f\u88c5\u4f8b\u3067\u3059\u3002\u30da\u30fc\u30b8\u30cd\u30fc\u30b7\u30e7\u30f3\u3001\u30bd\u30fc\u30c8\u3001\u30d5\u30a3\u30eb\u30bf\u30ea\u30f3\u30b0\u6a5f\u80fd\u3092\u5099\u3048\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ app\/Http\/Controllers\/UserController.php\npublic function index(Request $request)\n{\n    $query = User::query();\n\n    \/\/ \u691c\u7d22\u30d5\u30a3\u30eb\u30bf\u30fc\n    if ($search = $request-&gt;input('search')) {\n        $query-&gt;where('name', 'like', \"%{$search}%\")\n              -&gt;orWhere('email', 'like', \"%{$search}%\");\n    }\n\n    \/\/ \u30bd\u30fc\u30c8\n    $sortField = $request-&gt;input('sort_field', 'created_at');\n    $sortOrder = $request-&gt;input('sort_order', 'desc');\n    $query-&gt;orderBy($sortField, $sortOrder);\n\n    \/\/ \u30da\u30fc\u30b8\u30cd\u30fc\u30b7\u30e7\u30f3\n    $users = $query-&gt;paginate(10);\n\n    return response()-&gt;json([\n        'data' =&gt; $users-&gt;items(),\n        'pagination' =&gt; [\n            'current_page' =&gt; $users-&gt;currentPage(),\n            'last_page' =&gt; $users-&gt;lastPage(),\n            'per_page' =&gt; $users-&gt;perPage(),\n            'total' =&gt; $users-&gt;total()\n        ]\n    ]);\n}<\/pre>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ resources\/js\/data-table.js\nclass DynamicTable {\n    constructor(options) {\n        this.tableId = options.tableId;\n        this.apiUrl = options.apiUrl;\n        this.columns = options.columns;\n\n        this.currentPage = 1;\n        this.sortField = 'created_at';\n        this.sortOrder = 'desc';\n        this.searchQuery = '';\n\n        this.initializeTable();\n    }\n\n    async initializeTable() {\n        this.setupSearchHandler();\n        this.setupSortHandlers();\n        this.setupPagination();\n        await this.loadData();\n    }\n\n    async loadData() {\n        try {\n            const response = await $.ajax({\n                url: this.apiUrl,\n                method: 'GET',\n                data: {\n                    page: this.currentPage,\n                    sort_field: this.sortField,\n                    sort_order: this.sortOrder,\n                    search: this.searchQuery\n                }\n            });\n\n            this.renderTable(response.data);\n            this.updatePagination(response.pagination);\n\n        } catch (error) {\n            console.error('\u30c7\u30fc\u30bf\u53d6\u5f97\u30a8\u30e9\u30fc:', error);\n            \/\/ \u30a8\u30e9\u30fc\u8868\u793a\u51e6\u7406\n        }\n    }\n\n    renderTable(data) {\n        const tbody = document.querySelector(`#${this.tableId} tbody`);\n        tbody.innerHTML = data.map(item =&gt; this.renderRow(item)).join('');\n    }\n\n    renderRow(item) {\n        return `\n            &lt;tr&gt;\n                ${this.columns.map(column =&gt; `\n                    &lt;td&gt;${this.formatValue(item[column.field], column.format)}&lt;\/td&gt;\n                `).join('')}\n            &lt;\/tr&gt;\n        `;\n    }\n\n    \/\/ ... \u305d\u306e\u4ed6\u306e\u30e1\u30bd\u30c3\u30c9\n}<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-13\">\u30d5\u30a1\u30a4\u30eb\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u306e\u975e\u540c\u671f\u51e6\u7406<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u30d7\u30ed\u30b0\u30ec\u30b9\u30d0\u30fc\u4ed8\u304d\u306e\u30d5\u30a1\u30a4\u30eb\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u5b9f\u88c5\u4f8b\u3067\u3059\u3002\u5927\u5bb9\u91cf\u30d5\u30a1\u30a4\u30eb\u306b\u3082\u5bfe\u5fdc\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ app\/Http\/Controllers\/FileController.php\npublic function upload(Request $request)\n{\n    $request-&gt;validate([\n        'file' =&gt; 'required|file|max:10240' \/\/ 10MB\u5236\u9650\n    ]);\n\n    $file = $request-&gt;file('file');\n    $path = $file-&gt;store('uploads', 'public');\n\n    return response()-&gt;json([\n        'success' =&gt; true,\n        'path' =&gt; Storage::url($path),\n        'filename' =&gt; $file-&gt;getClientOriginalName()\n    ]);\n}<\/pre>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ resources\/js\/file-uploader.js\nclass FileUploader {\n    constructor(options) {\n        this.dropZone = document.querySelector(options.dropZoneSelector);\n        this.progressBar = document.querySelector(options.progressBarSelector);\n        this.uploadUrl = options.uploadUrl;\n\n        this.initializeUploader();\n    }\n\n    initializeUploader() {\n        this.dropZone.addEventListener('dragover', (e) =&gt; {\n            e.preventDefault();\n            this.dropZone.classList.add('dragover');\n        });\n\n        this.dropZone.addEventListener('drop', async (e) =&gt; {\n            e.preventDefault();\n            const files = e.dataTransfer.files;\n            await this.uploadFiles(files);\n        });\n    }\n\n    async uploadFiles(files) {\n        for (const file of files) {\n            await this.uploadSingleFile(file);\n        }\n    }\n\n    async uploadSingleFile(file) {\n        const formData = new FormData();\n        formData.append('file', file);\n\n        try {\n            const response = await $.ajax({\n                url: this.uploadUrl,\n                method: 'POST',\n                data: formData,\n                processData: false,\n                contentType: false,\n                xhr: () =&gt; {\n                    const xhr = new window.XMLHttpRequest();\n                    xhr.upload.addEventListener('progress', (e) =&gt; {\n                        if (e.lengthComputable) {\n                            const percentComplete = (e.loaded \/ e.total) * 100;\n                            this.updateProgress(percentComplete);\n                        }\n                    });\n                    return xhr;\n                }\n            });\n\n            this.handleUploadSuccess(response);\n\n        } catch (error) {\n            this.handleUploadError(error);\n        }\n    }\n\n    \/\/ ... \u305d\u306e\u4ed6\u306e\u30e1\u30bd\u30c3\u30c9\n}<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-14\">\u691c\u7d22\u6a5f\u80fd\u306e\u5b9f\u88c5\u3068\u30ad\u30e3\u30c3\u30b7\u30e5\u5236\u5fa1<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u30bf\u30a4\u30d4\u30f3\u30b0\u4e2d\u306e\u9023\u7d9aAPI\u30b3\u30fc\u30eb\u3092\u5236\u5fa1\u3057\u3001\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u6d3b\u7528\u3057\u305f\u52b9\u7387\u7684\u306a\u691c\u7d22\u6a5f\u80fd\u306e\u5b9f\u88c5\u4f8b\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ app\/Http\/Controllers\/SearchController.php\npublic function search(Request $request)\n{\n    $query = $request-&gt;input('query');\n    $cacheKey = 'search_' . md5($query);\n\n    \/\/ \u30ad\u30e3\u30c3\u30b7\u30e5\u304b\u3089\u7d50\u679c\u3092\u53d6\u5f97\n    return Cache::remember($cacheKey, now()-&gt;addMinutes(60), function () use ($query) {\n        return Product::search($query)\n            -&gt;with('category')\n            -&gt;take(10)\n            -&gt;get()\n            -&gt;map(function ($product) {\n                return [\n                    'id' =&gt; $product-&gt;id,\n                    'name' =&gt; $product-&gt;name,\n                    'price' =&gt; $product-&gt;price,\n                    'category' =&gt; $product-&gt;category-&gt;name\n                ];\n            });\n    });\n}<\/pre>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ resources\/js\/search.js\nclass LiveSearch {\n    constructor(options) {\n        this.searchInput = document.querySelector(options.inputSelector);\n        this.resultsContainer = document.querySelector(options.resultsSelector);\n        this.apiUrl = options.apiUrl;\n\n        this.debounceTimeout = null;\n        this.cache = new Map();\n\n        this.initializeSearch();\n    }\n\n    initializeSearch() {\n        this.searchInput.addEventListener('input', (e) =&gt; {\n            const query = e.target.value.trim();\n            this.handleSearch(query);\n        });\n    }\n\n    handleSearch(query) {\n        clearTimeout(this.debounceTimeout);\n\n        if (query.length &lt; 2) {\n            this.clearResults();\n            return;\n        }\n\n        \/\/ \u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u30c1\u30a7\u30c3\u30af\n        if (this.cache.has(query)) {\n            this.displayResults(this.cache.get(query));\n            return;\n        }\n\n        \/\/ \u30c7\u30d0\u30a6\u30f3\u30b9\u51e6\u7406\n        this.debounceTimeout = setTimeout(async () =&gt; {\n            await this.performSearch(query);\n        }, 300);\n    }\n\n    async performSearch(query) {\n        try {\n            const response = await $.ajax({\n                url: this.apiUrl,\n                method: 'GET',\n                data: { query }\n            });\n\n            \/\/ \u30ad\u30e3\u30c3\u30b7\u30e5\u306b\u7d50\u679c\u3092\u4fdd\u5b58\n            this.cache.set(query, response);\n            this.displayResults(response);\n\n        } catch (error) {\n            console.error('\u691c\u7d22\u30a8\u30e9\u30fc:', error);\n            \/\/ \u30a8\u30e9\u30fc\u8868\u793a\u51e6\u7406\n        }\n    }\n\n    \/\/ ... \u305d\u306e\u4ed6\u306e\u30e1\u30bd\u30c3\u30c9\n}<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-15\">\u7121\u9650\u30b9\u30af\u30ed\u30fc\u30eb\u306e\u5b9f\u88c5\u65b9\u6cd5<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u30b9\u30af\u30ed\u30fc\u30eb\u306b\u5fdc\u3058\u3066\u6b21\u306e\u30b3\u30f3\u30c6\u30f3\u30c4\u3092\u81ea\u52d5\u8aad\u307f\u8fbc\u307f\u3059\u308b\u5b9f\u88c5\u4f8b\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ app\/Http\/Controllers\/PostController.php\npublic function index(Request $request)\n{\n    $page = $request-&gt;input('page', 1);\n    $perPage = 10;\n\n    $posts = Post::with('author')\n        -&gt;orderBy('created_at', 'desc')\n        -&gt;paginate($perPage);\n\n    return response()-&gt;json([\n        'data' =&gt; $posts-&gt;items(),\n        'next_page' =&gt; $posts-&gt;hasMorePages() ? $posts-&gt;currentPage() + 1 : null\n    ]);\n}<\/pre>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ resources\/js\/infinite-scroll.js\nclass InfiniteScroll {\n    constructor(options) {\n        this.containerSelector = options.containerSelector;\n        this.apiUrl = options.apiUrl;\n        this.currentPage = 1;\n        this.loading = false;\n        this.hasMore = true;\n\n        this.initializeScroll();\n    }\n\n    initializeScroll() {\n        \/\/ Intersection Observer\u306e\u8a2d\u5b9a\n        const observer = new IntersectionObserver(\n            (entries) =&gt; this.handleIntersection(entries),\n            { threshold: 0.1 }\n        );\n\n        \/\/ \u76e3\u8996\u8981\u7d20\u306e\u8ffd\u52a0\n        const sentinel = document.querySelector('#scroll-sentinel');\n        if (sentinel) {\n            observer.observe(sentinel);\n        }\n    }\n\n    async handleIntersection(entries) {\n        const entry = entries[0];\n\n        if (entry.isIntersecting &amp;&amp; !this.loading &amp;&amp; this.hasMore) {\n            await this.loadMoreContent();\n        }\n    }\n\n    async loadMoreContent() {\n        this.loading = true;\n        this.showLoader();\n\n        try {\n            const response = await $.ajax({\n                url: this.apiUrl,\n                method: 'GET',\n                data: { page: this.currentPage + 1 }\n            });\n\n            if (response.data.length &gt; 0) {\n                this.appendContent(response.data);\n                this.currentPage++;\n                this.hasMore = response.next_page !== null;\n            } else {\n                this.hasMore = false;\n            }\n\n        } catch (error) {\n            console.error('\u30b3\u30f3\u30c6\u30f3\u30c4\u8aad\u307f\u8fbc\u307f\u30a8\u30e9\u30fc:', error);\n            \/\/ \u30a8\u30e9\u30fc\u8868\u793a\u51e6\u7406\n        } finally {\n            this.loading = false;\n            this.hideLoader();\n        }\n    }\n\n    appendContent(items) {\n        const container = document.querySelector(this.containerSelector);\n\n        items.forEach(item =&gt; {\n            const element = this.createItemElement(item);\n            container.appendChild(element);\n        });\n    }\n\n    createItemElement(item) {\n        const div = document.createElement('div');\n        div.className = 'content-item';\n        div.innerHTML = `\n            &lt;h3&gt;${item.title}&lt;\/h3&gt;\n            &lt;p&gt;${item.excerpt}&lt;\/p&gt;\n            &lt;div class=\"meta\"&gt;\n                &lt;span&gt;\u4f5c\u6210\u8005: ${item.author.name}&lt;\/span&gt;\n                &lt;span&gt;\u6295\u7a3f\u65e5: ${this.formatDate(item.created_at)}&lt;\/span&gt;\n            &lt;\/div&gt;\n        `;\n        return div;\n    }\n\n    \/\/ ... \u305d\u306e\u4ed6\u306e\u30e1\u30bd\u30c3\u30c9\n}<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u308c\u3089\u306e\u5b9f\u88c5\u4f8b\u306f\u3001\u5b9f\u969b\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u3059\u3050\u306b\u6d3b\u7528\u3067\u304d\u308b\u5f62\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002\u5404\u5b9f\u88c5\u306b\u304a\u3044\u3066\u3001\u4ee5\u4e0b\u306e\u70b9\u306b\u7279\u306b\u6ce8\u610f\u3092\u6255\u3063\u3066\u3044\u307e\u3059\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u30a8\u30e9\u30fc\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0\u306e\u5fb9\u5e95<\/li>\n\n\n\n<li>UX\u306e\u5411\u4e0a\uff08\u30ed\u30fc\u30c7\u30a3\u30f3\u30b0\u8868\u793a\u3001\u30d5\u30a3\u30fc\u30c9\u30d0\u30c3\u30af\uff09<\/li>\n\n\n\n<li>\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306e\u6700\u9069\u5316<\/li>\n\n\n\n<li>\u518d\u5229\u7528\u53ef\u80fd\u306a\u30b3\u30fc\u30c9\u8a2d\u8a08<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">\u6b21\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001\u3053\u308c\u3089\u306e\u5b9f\u88c5\u3092\u884c\u3046\u969b\u306e\u91cd\u8981\u306a\u6ce8\u610f\u70b9\u3068\u5bfe\u7b56\u306b\u3064\u3044\u3066\u8a73\u3057\u304f\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-16\">Ajax\u5b9f\u88c5\u6642\u306e\u91cd\u8981\u306a\u6ce8\u610f\u70b9\u3068\u5bfe\u7b56<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-17\">CSRF\u30c8\u30fc\u30af\u30f3\u5bfe\u7b56\u306e\u5b9f\u88c5\u65b9\u6cd5<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Laravel\u3067\u306f\u3001CSRF\u30c8\u30fc\u30af\u30f3\u306b\u3088\u308b\u4fdd\u8b77\u304c\u6a19\u6e96\u3067\u5b9f\u88c5\u3055\u308c\u3066\u3044\u307e\u3059\u304c\u3001Ajax\u901a\u4fe1\u6642\u306b\u306f\u7279\u5225\u306a\u914d\u616e\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-18\">1. \u30e1\u30bf\u30bf\u30b0\u3067\u306eCSRF\u30c8\u30fc\u30af\u30f3\u8a2d\u5b9a<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;!-- resources\/views\/layouts\/app.blade.php --&gt;\n&lt;meta name=\"csrf-token\" content=\"{{ csrf_token() }}\"&gt;<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-19\">2. Ajax\u30ea\u30af\u30a8\u30b9\u30c8\u3078\u306e\u30c8\u30fc\u30af\u30f3\u81ea\u52d5\u4ed8\u4e0e<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ resources\/js\/bootstrap.js\n$.ajaxSetup({\n    headers: {\n        'X-CSRF-TOKEN': document.querySelector('meta[name=\"csrf-token\"]').content\n    }\n});\n\n\/\/ \u307e\u305f\u306f\u3001axios\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\naxios.defaults.headers.common['X-CSRF-TOKEN'] = document.querySelector('meta[name=\"csrf-token\"]').content;<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-20\">3. \u30d5\u30a9\u30fc\u30e0\u3067\u306e\u30c8\u30fc\u30af\u30f3\u9001\u4fe1<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ Blade\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u5185\u3067\u306eCSRF\u30c8\u30fc\u30af\u30f3\u306e\u57cb\u3081\u8fbc\u307f\n@csrf\n\n\/\/ \u307e\u305f\u306f\u3001JavaScript\u3067\u30d5\u30a9\u30fc\u30e0\u30c7\u30fc\u30bf\u306b\u8ffd\u52a0\nconst formData = new FormData(form);\nformData.append('_token', document.querySelector('meta[name=\"csrf-token\"]').content);<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-21\">\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u30a8\u30e9\u30fc\u306e\u9069\u5207\u306a\u51e6\u7406<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u30a8\u30e9\u30fc\u3092\u9069\u5207\u306b\u51e6\u7406\u3057\u3001\u30e6\u30fc\u30b6\u30fc\u306b\u30d5\u30a3\u30fc\u30c9\u30d0\u30c3\u30af\u3092\u63d0\u4f9b\u3059\u308b\u65b9\u6cd5\u3092\u5b9f\u88c5\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ app\/Http\/Controllers\/ProductController.php\npublic function store(Request $request)\n{\n    try {\n        $validated = $request-&gt;validate([\n            'name' =&gt; 'required|string|max:255',\n            'price' =&gt; 'required|numeric|min:0',\n            'stock' =&gt; 'required|integer|min:0'\n        ]);\n\n        $product = Product::create($validated);\n\n        return response()-&gt;json([\n            'success' =&gt; true,\n            'data' =&gt; $product,\n            'message' =&gt; '\u5546\u54c1\u304c\u6b63\u5e38\u306b\u4f5c\u6210\u3055\u308c\u307e\u3057\u305f'\n        ]);\n\n    } catch (ValidationException $e) {\n        return response()-&gt;json([\n            'success' =&gt; false,\n            'errors' =&gt; $e-&gt;errors(),\n            'message' =&gt; '\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f'\n        ], 422);\n    } catch (\\Exception $e) {\n        return response()-&gt;json([\n            'success' =&gt; false,\n            'message' =&gt; '\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f',\n            'debug' =&gt; config('app.debug') ? $e-&gt;getMessage() : null\n        ], 500);\n    }\n}<\/pre>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ resources\/js\/validation-handler.js\nclass ValidationHandler {\n    constructor(form) {\n        this.form = form;\n        this.errorContainers = new Map();\n        this.initializeErrorContainers();\n    }\n\n    initializeErrorContainers() {\n        \/\/ \u5404\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u30a8\u30e9\u30fc\u30b3\u30f3\u30c6\u30ca\u3092\u521d\u671f\u5316\n        this.form.querySelectorAll('.form-group').forEach(group =&gt; {\n            const field = group.querySelector('[name]');\n            if (field) {\n                const errorContainer = group.querySelector('.error-message');\n                if (errorContainer) {\n                    this.errorContainers.set(field.name, errorContainer);\n                }\n            }\n        });\n    }\n\n    clearErrors() {\n        this.errorContainers.forEach(container =&gt; {\n            container.textContent = '';\n            container.classList.add('hidden');\n        });\n\n        this.form.querySelectorAll('.is-invalid').forEach(field =&gt; {\n            field.classList.remove('is-invalid');\n        });\n    }\n\n    handleErrors(errors) {\n        this.clearErrors();\n\n        Object.entries(errors).forEach(([field, messages]) =&gt; {\n            const container = this.errorContainers.get(field);\n            const inputField = this.form.querySelector(`[name=\"${field}\"]`);\n\n            if (container &amp;&amp; messages.length &gt; 0) {\n                container.textContent = messages[0];\n                container.classList.remove('hidden');\n            }\n\n            if (inputField) {\n                inputField.classList.add('is-invalid');\n            }\n        });\n    }\n}<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-22\">\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u30ea\u30b9\u30af\u3068\u305d\u306e\u5bfe\u51e6\u6cd5<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-23\">1. XSS\u653b\u6483\u5bfe\u7b56<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ config\/purifier.php\nreturn [\n    'encoding' =&gt; 'UTF-8',\n    'settings' =&gt; [\n        'default' =&gt; [\n            'HTML.Allowed' =&gt; 'b,strong,i,em,a[href|title],ul,ol,li,p[style],br,span[style],img[width|height|alt|src]',\n            'CSS.AllowedProperties' =&gt; 'font,font-size,font-weight,font-style,text-decoration,padding-left,color,background-color,text-align',\n            'AutoFormat.AutoParagraph' =&gt; true,\n            'AutoFormat.RemoveEmpty' =&gt; true,\n        ],\n    ],\n];\n\n\/\/ app\/Http\/Controllers\/CommentController.php\nuse Mews\\Purifier\\Facades\\Purifier;\n\npublic function store(Request $request)\n{\n    $validated = $request-&gt;validate([\n        'content' =&gt; 'required|string|max:1000'\n    ]);\n\n    \/\/ HTML\u306e\u5b89\u5168\u306a\u51e6\u7406\n    $cleanContent = Purifier::clean($validated['content']);\n\n    $comment = Comment::create([\n        'content' =&gt; $cleanContent,\n        'user_id' =&gt; auth()-&gt;id()\n    ]);\n\n    return response()-&gt;json([\n        'success' =&gt; true,\n        'data' =&gt; $comment\n    ]);\n}<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-24\">2. SQL\u30a4\u30f3\u30b8\u30a7\u30af\u30b7\u30e7\u30f3\u5bfe\u7b56<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ \u60aa\u3044\u4f8b\uff08\u76f4\u63a5\u7684\u306aSQL\u306e\u4f7f\u7528\uff09\n$results = DB::select(\"SELECT * FROM users WHERE name LIKE '%$searchTerm%'\");\n\n\/\/ \u826f\u3044\u4f8b\uff08\u30af\u30a8\u30ea\u30d3\u30eb\u30c0\u30fc\u306e\u4f7f\u7528\uff09\n$results = User::where('name', 'like', \"%{$searchTerm}%\")-&gt;get();\n\n\/\/ \u3055\u3089\u306b\u826f\u3044\u4f8b\uff08\u30d0\u30a4\u30f3\u30c7\u30a3\u30f3\u30b0\u306e\u4f7f\u7528\uff09\n$results = User::where('name', 'like', DB::raw('?'))\n    -&gt;setBindings([\"%{$searchTerm}%\"])\n    -&gt;get();<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-25\">3. \u30ec\u30fc\u30c8\u5236\u9650\u306e\u5b9f\u88c5<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ routes\/api.php\nRoute::middleware(['auth:api', 'throttle:60,1'])-&gt;group(function () {\n    Route::post('\/comments', [CommentController::class, 'store']);\n});\n\n\/\/ \u30ab\u30b9\u30bf\u30e0\u30ec\u30fc\u30c8\u5236\u9650\u306e\u5b9f\u88c5\nclass CustomThrottle extends Middleware\n{\n    protected function resolveRequestSignature($request)\n    {\n        return sha1(implode('|', [\n            $request-&gt;method(),\n            $request-&gt;route()-&gt;getDomain(),\n            $request-&gt;ip(),\n            $request-&gt;input('user_id')  \/\/ \u30e6\u30fc\u30b6\u30fc\u56fa\u6709\u306e\u5236\u9650\n        ]));\n    }\n}<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-26\">4. \u30d5\u30a1\u30a4\u30eb\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u306e\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ config\/filesystems.php\n'uploads' =&gt; [\n    'driver' =&gt; 'local',\n    'root' =&gt; storage_path('app\/public\/uploads'),\n    'url' =&gt; env('APP_URL').'\/storage\/uploads',\n    'visibility' =&gt; 'public',\n],\n\n\/\/ app\/Http\/Controllers\/FileController.php\npublic function upload(Request $request)\n{\n    $request-&gt;validate([\n        'file' =&gt; [\n            'required',\n            'file',\n            'max:10240',  \/\/ 10MB\u5236\u9650\n            'mimes:jpeg,png,pdf,doc,docx',  \/\/ \u8a31\u53ef\u3059\u308b\u62e1\u5f35\u5b50\n        ]\n    ]);\n\n    try {\n        $file = $request-&gt;file('file');\n\n        \/\/ \u30d5\u30a1\u30a4\u30eb\u540d\u306e\u30b5\u30cb\u30bf\u30a4\u30ba\n        $safeName = str_slug(pathinfo($file-&gt;getClientOriginalName(), PATHINFO_FILENAME)) . \n                   '.' . $file-&gt;getClientOriginalExtension();\n\n        \/\/ \u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u51e6\u7406\n        $path = $file-&gt;storeAs(\n            'uploads\/' . date('Y\/m'),\n            $safeName,\n            'public'\n        );\n\n        return response()-&gt;json([\n            'success' =&gt; true,\n            'path' =&gt; Storage::url($path)\n        ]);\n\n    } catch (\\Exception $e) {\n        return response()-&gt;json([\n            'success' =&gt; false,\n            'message' =&gt; '\u30d5\u30a1\u30a4\u30eb\u306e\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u306b\u5931\u6557\u3057\u307e\u3057\u305f'\n        ], 500);\n    }\n}<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u308c\u3089\u306e\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u5bfe\u7b56\u3092\u5b9f\u88c5\u3059\u308b\u3053\u3068\u3067\u3001\u5b89\u5168\u306aAjax\u901a\u4fe1\u3092\u5b9f\u73fe\u3067\u304d\u307e\u3059\u3002\u6b21\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3067\u306f\u3001\u3055\u3089\u306b\u4fdd\u5b88\u6027\u3092\u9ad8\u3081\u308b\u305f\u3081\u306e\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9\u306b\u3064\u3044\u3066\u89e3\u8aac\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-27\">\u4fdd\u5b88\u6027\u3092\u9ad8\u3081\u308b\u305f\u3081\u306e\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-28\">\u30b3\u30fc\u30c9\u306e\u5206\u5272\u3068\u518d\u5229\u7528\u53ef\u80fd\u306a\u8a2d\u8a08<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-29\">1. \u30b5\u30fc\u30d3\u30b9\u30af\u30e9\u30b9\u306e\u6d3b\u7528<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">\u30d3\u30b8\u30cd\u30b9\u30ed\u30b8\u30c3\u30af\u3092\u30b5\u30fc\u30d3\u30b9\u30af\u30e9\u30b9\u306b\u5206\u96e2\u3059\u308b\u3053\u3068\u3067\u3001\u30b3\u30fc\u30c9\u306e\u518d\u5229\u7528\u6027\u3068\u4fdd\u5b88\u6027\u304c\u5411\u4e0a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ app\/Services\/ProductService.php\nclass ProductService\n{\n    public function createProduct(array $data): Product\n    {\n        \/\/ \u30c8\u30e9\u30f3\u30b6\u30af\u30b7\u30e7\u30f3\u51e6\u7406\n        return DB::transaction(function () use ($data) {\n            $product = Product::create([\n                'name' =&gt; $data['name'],\n                'price' =&gt; $data['price'],\n                'description' =&gt; $data['description']\n            ]);\n\n            \/\/ \u5728\u5eab\u60c5\u5831\u306e\u4f5c\u6210\n            $product-&gt;stock()-&gt;create([\n                'quantity' =&gt; $data['initial_stock']\n            ]);\n\n            \/\/ \u5546\u54c1\u753b\u50cf\u306e\u4fdd\u5b58\n            if (isset($data['images'])) {\n                foreach ($data['images'] as $image) {\n                    $this-&gt;attachProductImage($product, $image);\n                }\n            }\n\n            return $product;\n        });\n    }\n\n    private function attachProductImage(Product $product, UploadedFile $image): void\n    {\n        $path = $image-&gt;store('products', 'public');\n        $product-&gt;images()-&gt;create(['path' =&gt; $path]);\n    }\n}\n\n\/\/ app\/Http\/Controllers\/ProductController.php\nclass ProductController extends Controller\n{\n    private ProductService $productService;\n\n    public function __construct(ProductService $productService)\n    {\n        $this-&gt;productService = $productService;\n    }\n\n    public function store(ProductRequest $request)\n    {\n        try {\n            $product = $this-&gt;productService-&gt;createProduct($request-&gt;validated());\n\n            return response()-&gt;json([\n                'success' =&gt; true,\n                'data' =&gt; $product-&gt;load('images', 'stock')\n            ]);\n        } catch (\\Exception $e) {\n            return response()-&gt;json([\n                'success' =&gt; false,\n                'message' =&gt; '\u5546\u54c1\u306e\u4f5c\u6210\u306b\u5931\u6557\u3057\u307e\u3057\u305f'\n            ], 500);\n        }\n    }\n}<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-30\">2. \u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u30b3\u30fc\u30c9\u306e\u6574\u7406<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">JavaScript\u30b3\u30fc\u30c9\u3092\u30e2\u30b8\u30e5\u30fc\u30eb\u5316\u3057\u3001\u518d\u5229\u7528\u53ef\u80fd\u306a\u30af\u30e9\u30b9\u3068\u3057\u3066\u5b9f\u88c5\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ resources\/js\/services\/ApiService.js\nclass ApiService {\n    constructor(baseURL) {\n        this.baseURL = baseURL;\n        this.defaultHeaders = {\n            'Content-Type': 'application\/json',\n            'X-Requested-With': 'XMLHttpRequest'\n        };\n    }\n\n    async get(endpoint, params = {}) {\n        const url = new URL(`${this.baseURL}${endpoint}`);\n        Object.keys(params).forEach(key =&gt; \n            url.searchParams.append(key, params[key])\n        );\n\n        const response = await fetch(url, {\n            method: 'GET',\n            headers: this.defaultHeaders\n        });\n\n        return this.handleResponse(response);\n    }\n\n    async post(endpoint, data) {\n        const response = await fetch(`${this.baseURL}${endpoint}`, {\n            method: 'POST',\n            headers: this.defaultHeaders,\n            body: JSON.stringify(data)\n        });\n\n        return this.handleResponse(response);\n    }\n\n    async handleResponse(response) {\n        const data = await response.json();\n\n        if (!response.ok) {\n            throw new ApiError(response.status, data);\n        }\n\n        return data;\n    }\n}\n\n\/\/ resources\/js\/services\/ProductService.js\nclass ProductService extends ApiService {\n    constructor() {\n        super('\/api');\n    }\n\n    async getProducts(params = {}) {\n        return this.get('\/products', params);\n    }\n\n    async createProduct(productData) {\n        return this.post('\/products', productData);\n    }\n}<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-31\">\u52b9\u679c\u7684\u306a\u30a8\u30e9\u30fc\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0\u306e\u5b9f\u88c5<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-32\">1. \u30ab\u30b9\u30bf\u30e0\u4f8b\u5916\u30af\u30e9\u30b9\u306e\u4f5c\u6210<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ app\/Exceptions\/Api\/ApiException.php\nabstract class ApiException extends Exception\n{\n    protected $statusCode = 500;\n    protected $errorCode;\n\n    public function render()\n    {\n        return response()-&gt;json([\n            'success' =&gt; false,\n            'error' =&gt; [\n                'code' =&gt; $this-&gt;errorCode,\n                'message' =&gt; $this-&gt;getMessage()\n            ]\n        ], $this-&gt;statusCode);\n    }\n}\n\n\/\/ app\/Exceptions\/Api\/ProductNotFoundException.php\nclass ProductNotFoundException extends ApiException\n{\n    protected $statusCode = 404;\n    protected $errorCode = 'PRODUCT_NOT_FOUND';\n\n    public function __construct($message = null)\n    {\n        parent::__construct($message ?? '\u6307\u5b9a\u3055\u308c\u305f\u5546\u54c1\u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093');\n    }\n}\n\n\/\/ app\/Exceptions\/Handler.php\nclass Handler extends ExceptionHandler\n{\n    public function render($request, Throwable $exception)\n    {\n        if ($request-&gt;expectsJson()) {\n            if ($exception instanceof ValidationException) {\n                return response()-&gt;json([\n                    'success' =&gt; false,\n                    'error' =&gt; [\n                        'code' =&gt; 'VALIDATION_ERROR',\n                        'message' =&gt; '\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f',\n                        'errors' =&gt; $exception-&gt;errors()\n                    ]\n                ], 422);\n            }\n\n            if ($exception instanceof ApiException) {\n                return $exception-&gt;render();\n            }\n        }\n\n        return parent::render($request, $exception);\n    }\n}<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-33\">2. \u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u3067\u306e\u30a8\u30e9\u30fc\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ resources\/js\/utils\/ErrorHandler.js\nclass ErrorHandler {\n    static handle(error) {\n        if (error.response) {\n            switch (error.response.status) {\n                case 422:\n                    this.handleValidationError(error.response.data.error.errors);\n                    break;\n                case 404:\n                    this.handleNotFoundError(error.response.data.error.message);\n                    break;\n                case 403:\n                    this.handleForbiddenError();\n                    break;\n                default:\n                    this.handleGenericError(error);\n            }\n        } else {\n            this.handleNetworkError();\n        }\n    }\n\n    static handleValidationError(errors) {\n        \/\/ \u30d5\u30a9\u30fc\u30e0\u306e\u30a8\u30e9\u30fc\u8868\u793a\u3092\u66f4\u65b0\n        Object.entries(errors).forEach(([field, messages]) =&gt; {\n            const errorElement = document.querySelector(`#${field}-error`);\n            if (errorElement) {\n                errorElement.textContent = messages[0];\n                errorElement.classList.remove('hidden');\n            }\n        });\n    }\n\n    \/\/ \u305d\u306e\u4ed6\u306e\u30a8\u30e9\u30fc\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0\u30e1\u30bd\u30c3\u30c9...\n}<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"i-34\">\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9\u306e\u66f8\u304d\u65b9\u3068\u5b9f\u884c\u65b9\u6cd5<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-35\">1. API\u30c6\u30b9\u30c8\u306e\u5b9f\u88c5<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ tests\/Feature\/Api\/ProductApiTest.php\nclass ProductApiTest extends TestCase\n{\n    use RefreshDatabase;\n\n    public function setUp(): void\n    {\n        parent::setUp();\n        $this-&gt;user = User::factory()-&gt;create();\n    }\n\n    public function test_can_create_product()\n    {\n        $productData = [\n            'name' =&gt; 'Test Product',\n            'price' =&gt; 1000,\n            'description' =&gt; 'Test Description'\n        ];\n\n        $response = $this-&gt;actingAs($this-&gt;user)\n            -&gt;postJson('\/api\/products', $productData);\n\n        $response-&gt;assertStatus(200)\n            -&gt;assertJson([\n                'success' =&gt; true,\n                'data' =&gt; [\n                    'name' =&gt; $productData['name'],\n                    'price' =&gt; $productData['price']\n                ]\n            ]);\n\n        $this-&gt;assertDatabaseHas('products', [\n            'name' =&gt; $productData['name']\n        ]);\n    }\n\n    public function test_validates_required_fields()\n    {\n        $response = $this-&gt;actingAs($this-&gt;user)\n            -&gt;postJson('\/api\/products', []);\n\n        $response-&gt;assertStatus(422)\n            -&gt;assertJsonValidationErrors(['name', 'price']);\n    }\n}<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-36\">2. JavaScript\u306e\u30e6\u30cb\u30c3\u30c8\u30c6\u30b9\u30c8<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ tests\/js\/services\/ProductService.test.js\nimport ProductService from '@\/services\/ProductService';\n\ndescribe('ProductService', () =&gt; {\n    let productService;\n\n    beforeEach(() =&gt; {\n        productService = new ProductService();\n        global.fetch = jest.fn();\n    });\n\n    it('gets products successfully', async () =&gt; {\n        const mockProducts = [\n            { id: 1, name: 'Product 1' },\n            { id: 2, name: 'Product 2' }\n        ];\n\n        global.fetch.mockImplementationOnce(() =&gt;\n            Promise.resolve({\n                ok: true,\n                json: () =&gt; Promise.resolve({ data: mockProducts })\n            })\n        );\n\n        const result = await productService.getProducts();\n        expect(result.data).toEqual(mockProducts);\n    });\n\n    it('handles api errors correctly', async () =&gt; {\n        global.fetch.mockImplementationOnce(() =&gt;\n            Promise.resolve({\n                ok: false,\n                status: 422,\n                json: () =&gt; Promise.resolve({\n                    error: {\n                        message: 'Validation failed'\n                    }\n                })\n            })\n        );\n\n        await expect(productService.createProduct({}))\n            .rejects\n            .toThrow('Validation failed');\n    });\n});<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"i-37\">3. E2E\u30c6\u30b9\u30c8\u306e\u5b9f\u88c5<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ tests\/e2e\/product-management.spec.js\ndescribe('Product Management', () =&gt; {\n    beforeEach(() =&gt; {\n        cy.login();  \/\/ \u30ab\u30b9\u30bf\u30e0\u30b3\u30de\u30f3\u30c9\n        cy.visit('\/products');\n    });\n\n    it('creates a new product via ajax', () =&gt; {\n        cy.get('[data-test=\"add-product-button\"]').click();\n\n        cy.get('[data-test=\"product-name-input\"]')\n            .type('New Test Product');\n\n        cy.get('[data-test=\"product-price-input\"]')\n            .type('1000');\n\n        cy.get('[data-test=\"save-product-button\"]').click();\n\n        \/\/ \u6210\u529f\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u78ba\u8a8d\n        cy.get('[data-test=\"success-message\"]')\n            .should('be.visible')\n            .and('contain', '\u5546\u54c1\u304c\u4f5c\u6210\u3055\u308c\u307e\u3057\u305f');\n\n        \/\/ \u5546\u54c1\u30ea\u30b9\u30c8\u306e\u66f4\u65b0\u3092\u78ba\u8a8d\n        cy.get('[data-test=\"product-list\"]')\n            .should('contain', 'New Test Product');\n    });\n\n    it('shows validation errors', () =&gt; {\n        cy.get('[data-test=\"add-product-button\"]').click();\n        cy.get('[data-test=\"save-product-button\"]').click();\n\n        cy.get('[data-test=\"name-error\"]')\n            .should('be.visible')\n            .and('contain', '\u5546\u54c1\u540d\u306f\u5fc5\u9808\u3067\u3059');\n    });\n});<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u308c\u3089\u306e\u30d9\u30b9\u30c8\u30d7\u30e9\u30af\u30c6\u30a3\u30b9\u3092\u9069\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u4ee5\u4e0b\u306e\u30e1\u30ea\u30c3\u30c8\u304c\u5f97\u3089\u308c\u307e\u3059\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u30b3\u30fc\u30c9\u306e\u4fdd\u5b88\u6027\u5411\u4e0a<\/strong><\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u8cac\u4efb\u306e\u660e\u78ba\u306a\u5206\u96e2<\/li>\n\n\n\n<li>\u518d\u5229\u7528\u53ef\u80fd\u306a\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8<\/li>\n\n\n\n<li>\u30c6\u30b9\u30c8\u5bb9\u6613\u6027\u306e\u5411\u4e0a<\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u958b\u767a\u52b9\u7387\u306e\u5411\u4e0a<\/strong><\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5171\u901a\u51e6\u7406\u306e\u518d\u5229\u7528<\/li>\n\n\n\n<li>\u30a8\u30e9\u30fc\u306e\u65e9\u671f\u767a\u898b<\/li>\n\n\n\n<li>\u30c7\u30d0\u30c3\u30b0\u306e\u5bb9\u6613\u3055<\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\u54c1\u8cea\u306e\u5411\u4e0a<\/strong><\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u81ea\u52d5\u30c6\u30b9\u30c8\u306b\u3088\u308b\u54c1\u8cea\u4fdd\u8a3c<\/li>\n\n\n\n<li>\u4e00\u8cab\u3057\u305f\u30a8\u30e9\u30fc\u30cf\u30f3\u30c9\u30ea\u30f3\u30b0<\/li>\n\n\n\n<li>\u30bb\u30ad\u30e5\u30a2\u306a\u30b3\u30fc\u30c9\u5b9f\u88c5<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u3053\u308c\u3089\u306e\u5b9f\u8df5\u306b\u3088\u308a\u3001\u9577\u671f\u7684\u306a\u30e1\u30f3\u30c6\u30ca\u30f3\u30b9\u6027\u3068\u62e1\u5f35\u6027\u306e\u9ad8\u3044Ajax\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u69cb\u7bc9\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Warning: Undefined array key &#8220;is_admin&#8221; in \/home\/xs392991\/dexall.co.jp\/public_html\/articles\/wp-content\/themes\/ &#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"class_list":["post-2494","post","type-post","status-publish","format-standard","category-php","nothumb"],"_links":{"self":[{"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=\/wp\/v2\/posts\/2494","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2494"}],"version-history":[{"count":2,"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=\/wp\/v2\/posts\/2494\/revisions"}],"predecessor-version":[{"id":2496,"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=\/wp\/v2\/posts\/2494\/revisions\/2496"}],"wp:attachment":[{"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2494"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2494"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dexall.co.jp\/articles\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2494"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}