{"id":893,"date":"2023-05-17T21:44:41","date_gmt":"2023-05-17T12:44:41","guid":{"rendered":"https:\/\/shinke1987.net\/?p=893"},"modified":"2023-09-17T15:25:45","modified_gmt":"2023-09-17T06:25:45","slug":"laravel%e3%81%a7%e6%96%b0%e8%a6%8f%e3%83%9a%e3%83%bc%e3%82%b8%e3%82%92%e4%bd%9c%e6%88%90%e3%81%97%e3%81%a6%e3%81%bf%e3%82%8b","status":"publish","type":"post","link":"https:\/\/shinke1987.net\/?p=893","title":{"rendered":"Laravel\u3067\u65b0\u898f\u30da\u30fc\u30b8\u3092\u4f5c\u6210\u3057\u3066\u307f\u308b"},"content":{"rendered":"\n<h2 id=\"toc0\" class=\"wp-block-heading\">\u76ee\u7684<\/h2>\n\n\n\n<p>resources\/views\/components \u5185\u306e\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3067\u3001<br>\u5358\u4f53\u3067\u8868\u793a\u53ef\u80fd\u306a\u3082\u306e\u3092\u8868\u793a\u3057\u3066\u307f\u308b\u3002<\/p>\n\n\n\n<h2 id=\"toc1\" class=\"wp-block-heading\">\u7d50\u8ad6<\/h2>\n\n\n\n<p>Blade\u306b\u3064\u3044\u3066\u3082\u3063\u3068\u8a73\u3057\u304f\u306a\u308b\u3068\u3001<br>\u300cx-\u300d\u3067\u59cb\u307e\u308b\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u3078\u306e\u7406\u89e3\u3092\u6df1\u3081\u308b\u3068\u3001<br>Laravel\u3092\u5229\u7528\u3057\u305f\u8868\u793a\u306b\u3064\u3044\u3066\u697d\u3060\u3068\u611f\u3058\u308b\u3053\u3068\u304c\u3067\u304d\u305d\u3046\u3002<\/p>\n\n\n\n<h2 id=\"toc2\" class=\"wp-block-heading\">\u624b\u9806<\/h2>\n\n\n\n<h3 id=\"toc3\" class=\"wp-block-heading\">\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u3092\u4f5c\u6210<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n$ .\/vendor\/bin\/sail artisan make:controller TestComponents\n<\/pre><\/div>\n\n\n<p>\u4f5c\u6210\u3057\u305f\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u3092\u958b\u3044\u3066\u3001\u6b21\u306e\u3088\u3046\u306b\u7de8\u96c6\u3059\u308b\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\n&lt;?php\nnamespace App\\Http\\Controllers;\nuse Illuminate\\Http\\Request;\n\nclass TestComponents extends Controller\n{\n    public function showTestComponents() {\n        return view(&#039;TestComponents&#039;);\n    }\n}\n<\/pre><\/div>\n\n\n<h3 id=\"toc4\" class=\"wp-block-heading\">\u30d3\u30e5\u30fc\u3092\u4f5c\u6210<\/h3>\n\n\n\n<p>resources\/views\/TestComponents.blade.php \u3092\u65b0\u898f\u4f5c\u6210\u3057\u3001\u6b21\u306e\u3088\u3046\u306b\u7de8\u96c6\u3059\u308b\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: xml; title: ; notranslate\" title=\"\">\n&lt;!DOCTYPE html&gt;\n&lt;html lang=&quot;{{ str_replace(&#039;_&#039;, &#039;-&#039;, app() -&gt; getLocale()) }}&quot;&gt;\n    &lt;head&gt;\n        &lt;meta charset=&quot;utf-8&quot;&gt;\n        \n        &lt;title&gt;TestComponents&lt;\/title&gt;\n\n        &lt;!-- Scripts --&gt;\n        @vite(&#x5B;&#039;resources\/css\/app.css&#039;, &#039;resources\/js\/app.js&#039;])\n    &lt;\/head&gt;\n    &lt;body&gt;\n        &lt;br&gt;&lt;br&gt;\n        &lt;x-primary-button&gt;\n            x-primary-button\n        &lt;\/x-primary-button&gt;\n        &lt;br&gt;&lt;br&gt;\n        &lt;x-secondary-button&gt;\n            x-secondary-button\n        &lt;\/x-secondary-button&gt;\n        &lt;br&gt;&lt;br&gt;\n        &lt;x-text-input&gt;\n            x-text-input\n        &lt;\/x-text-input&gt;\n        &lt;br&gt;&lt;br&gt;\n        &lt;x-responsive-nav-link&gt;\n            x-responsive-nav-link\n        &lt;\/x-responsive-nav-link&gt;\n        &lt;br&gt;&lt;br&gt;\n        &lt;x-nav-link&gt;\n            x-nav-link\n        &lt;\/x-nav-link&gt;\n        &lt;br&gt;&lt;br&gt;\n        &lt;x-input-label&gt;\n            x-input-label\n        &lt;\/x-input-label&gt;\n        &lt;br&gt;&lt;br&gt;\n        &lt;x-danger-button&gt;\n            x-danger-button\n        &lt;\/x-danger-button&gt;\n        &lt;br&gt;&lt;br&gt;\n        &lt;x-application-logo&gt;\n            x-application-logo\n        &lt;\/x-application-logo&gt;\n        &lt;br&gt;&lt;br&gt;\n\n    &lt;\/body&gt;\n&lt;\/html&gt;\n<\/pre><\/div>\n\n\n<h3 id=\"toc5\" class=\"wp-block-heading\">\u30eb\u30fc\u30c8\u3092\u4f5c\u6210<\/h3>\n\n\n\n<p>routes\/web.php \u306b\u4e0b\u8a18\u3092\u8ffd\u8a18\u3059\u308b\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; title: ; notranslate\" title=\"\">\nuse App\\Http\\Controllers\\TestComponents;\nRoute::get(&#039;\/TestComponents&#039;, &#x5B;TestComponents::class, &#039;showTestComponents&#039;]) -&gt; name (&#039;TestComponents&#039;);\n<\/pre><\/div>\n\n\n<p>\u4e0b\u8a18\u30b3\u30de\u30f3\u30c9\u3067\u5ff5\u306e\u305f\u3081\u306b\u3001\u6709\u52b9\u306b\u306a\u3063\u3066\u3044\u308b\u30eb\u30fc\u30c8\u8a2d\u5b9a\u306e\u4e00\u89a7\u3092\u8868\u793a\u3057\u3066\u78ba\u8a8d\u3057\u3066\u3082\u826f\u3044\u304b\u3082\u3057\u308c\u306a\u3044\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n$ .\/vendor\/bin\/sail artisan route:list\n<\/pre><\/div>\n\n\n<h3 id=\"toc6\" class=\"wp-block-heading\">\u6700\u5f8c\u306b\u78ba\u8a8d<\/h3>\n\n\n\n<p>http:\/\/localhost\/TestComponents \u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3068\u6b21\u306e\u3088\u3046\u306b\u8868\u793a\u3055\u308c\u305f\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"826\" height=\"1024\" src=\"https:\/\/shinke1987.net\/wp-content\/uploads\/2023\/05\/2023-05-17-21.24.41-localhost-2577ca0d49fa-826x1024.png\" alt=\"\" class=\"wp-image-894\" srcset=\"https:\/\/shinke1987.net\/wp-content\/uploads\/2023\/05\/2023-05-17-21.24.41-localhost-2577ca0d49fa-826x1024.png 826w, https:\/\/shinke1987.net\/wp-content\/uploads\/2023\/05\/2023-05-17-21.24.41-localhost-2577ca0d49fa-242x300.png 242w, https:\/\/shinke1987.net\/wp-content\/uploads\/2023\/05\/2023-05-17-21.24.41-localhost-2577ca0d49fa-768x953.png 768w\" sizes=\"auto, (max-width: 826px) 100vw, 826px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>\u76ee\u7684 resources\/views\/components \u5185\u306e\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3067\u3001\u5358\u4f53\u3067\u8868\u793a\u53ef\u80fd\u306a\u3082\u306e\u3092\u8868\u793a\u3057\u3066\u307f\u308b\u3002 \u7d50\u8ad6 Blade\u306b\u3064\u3044\u3066\u3082\u3063\u3068\u8a73\u3057\u304f\u306a\u308b\u3068\u3001\u300cx-\u300d\u3067\u59cb\u307e\u308b\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u3078\u306e\u7406\u89e3\u3092\u6df1\u3081\u308b\u3068\u3001Lar [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[96,80],"tags":[88,81],"class_list":["post-893","post","type-post","status-publish","format-standard","hentry","category-laravel","category-php","tag-laravel","tag-php"],"_links":{"self":[{"href":"https:\/\/shinke1987.net\/index.php?rest_route=\/wp\/v2\/posts\/893","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/shinke1987.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/shinke1987.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/shinke1987.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/shinke1987.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=893"}],"version-history":[{"count":1,"href":"https:\/\/shinke1987.net\/index.php?rest_route=\/wp\/v2\/posts\/893\/revisions"}],"predecessor-version":[{"id":895,"href":"https:\/\/shinke1987.net\/index.php?rest_route=\/wp\/v2\/posts\/893\/revisions\/895"}],"wp:attachment":[{"href":"https:\/\/shinke1987.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=893"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/shinke1987.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=893"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/shinke1987.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=893"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}