{"id":11865,"date":"2023-08-13T07:00:38","date_gmt":"2023-08-12T22:00:38","guid":{"rendered":"https:\/\/blog.capilano-fw.com\/?p=11865"},"modified":"2023-10-10T03:27:03","modified_gmt":"2023-10-09T18:27:03","slug":"inertia%e3%82%92%e9%99%a4%e5%a4%96%ef%bc%81laravel-breeze-vue-3%e3%81%a7%e3%80%8c%e3%81%82%e3%81%ae%e9%a0%83%e3%81%ae%e3%82%88%e3%81%86%e3%81%aa%e3%80%8d%e3%82%b7%e3%83%b3%e3%83%97%e3%83%ab%e9%96%8b","status":"publish","type":"post","link":"https:\/\/blog.capilano-fw.com\/?p=11865","title":{"rendered":"Inertia\u3092\u9664\u5916\uff01Laravel Breeze + Vue 3\u3067\u300c\u3042\u306e\u9803\u306e\u3088\u3046\u306a\u300d\u30b7\u30f3\u30d7\u30eb\u958b\u767a\u3059\u308b\u65b9\u6cd5"},"content":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u3053\u306e\u9593\u30c4\u30a4\u30c3\u30bf\u30fc\u3092\u773a\u3081\u3066\u3044\u308b\u3068\u00a0<a href=\"https:\/\/qiita.com\/fruitriin\/items\/81691ce68cf3678f3bda#vue3%E3%81%AE%E8%A1%B0%E9%80%80%E3%82%92%E6%8B%9B%E3%81%84%E3%81%9F%E3%81%AE%E3%81%AFscript-setup%E3%81%8B%E3%82%82%E3%81%97%E3%82%8C%E3%81%AA%E3%81%84compositionapi%E3%81%A8%E3%81%84%E3%81%86%E8%80%83%E5%AF%9F\" target=\"_blank\" rel=\"noopener\"><strong>Vue3\u306e\u8870\u9000\u3092\u62db\u3044\u305f\u306e\u306f&lt;script setup&gt;\u3068CompositionAPI\u304b\u3082\u3057\u308c\u306a\u3044 \u3068\u3044\u3046\u8003\u5bdf<\/strong><\/a> \u3068\u3044\u3046\u8a71\u984c\u306b\u306a\u3063\u305f\u30d6\u30ed\u30b0\u8a18\u4e8b\u304c\u6d41\u308c\u3066\u304d\u307e\u3057\u305f\u3002<\/p>\n<p>\u500b\u4eba\u7684\u306b\u306f<code>Composition API<\/code>\u3082\u304a\u4ed5\u4e8b\u3067\u306f\u4f7f\u3044\u307e\u3059\u304c\u3001\u6b63\u76f4\u300c<strong>\u3088\u3063\u307d\u3069\u5927\u898f\u6a21\u3058\u3083\u306a\u3044\u9650\u308a\u30aa\u30fc\u30d0\u30fc\u30b9\u30da\u30c3\u30af\u3060\u3063\u305f\u308a\u3057\u306a\u3044\u306e\u304b\u306a\u2026\ud83e\udd14<\/strong>\u300d\u3068\u3082\u601d\u3063\u305f\u308a\u3082\u3059\u308b\u306e\u3067\u3001\u5171\u611f\u3059\u308b\u90e8\u5206\u304c\u591a\u304b\u3063\u305f\u3067\u3059\u3002<\/p>\n<p>\u3084\u3063\u3071\u308a\u3001<code>Vue 2<\/code>\u306e\u300c<strong>\u30b7\u30f3\u30d7\u30eb\uff06\u5f37\u529b<\/strong>\u300d\u306e\u6b8b\u50cf\u304c\u6b8b\u3063\u3066\u3044\u308b\u3093\u3067\u3059\uff08\u7b11\uff09<\/p>\n<p>\u305d\u3057\u3066\u3001\u305d\u3093\u306a\u5f71\u97ff\u3082\u3042\u308a\u601d\u3044\u3064\u3044\u305f\u306e\u304c\u300c<strong>Laravel Breeze \u3067 Vue 3 \u306f\u4f7f\u3046\u3051\u3069\u3001Inertia\u306f\u4f7f\u308f\u306a\u3044\u30b7\u30f3\u30d7\u30eb\u74b0\u5883\u3092\u3064\u304f\u3063\u3066\u307f\u305f\u3044<\/strong>\u300d\u3068\u3044\u3046\u3082\u306e\u3067\u3057\u305f\u3002<\/p>\n<p><strong>\u3010\u8ffd\u8a18\uff1a2023.8.14\u3011<br \/>\n<\/strong>\u3053\u3061\u3089\u3001\u8aad\u3093\u3067\u3044\u305f\u3060\u3044\u305f\u65b9\u306b\u8aa4\u89e3\u3092\u4e0e\u3048\u3066\u3057\u307e\u3063\u3066\u3044\u305f\u3088\u3046\u3067\u3057\u305f\u3002<br \/>\n\u4e0a\u8a18\u306f\u300c\u30d3\u30eb\u30c9\u3059\u308b\u306e\u306f<code>npm<\/code>\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u307f\u3067\u3001\u30b3\u30fc\u30c9\u306f\u30d3\u30eb\u30c9\u3057\u306a\u3044\u300d\u3068\u3044\u3046\u610f\u5473\u306b\u306a\u308a\u307e\u3059\u3002\u6df7\u4e71\u3055\u305b\u3066\u3057\u307e\u3063\u3066\u7533\u3057\u8a33\u306a\u3044\u3067\u3059\u2026\ud83d\ude05<\/p>\n<p>\u3053\u3061\u3089\u3082\u3001<code>vite<\/code>\u3067\u30b4\u30ea\u30b4\u30ea\u306b\u30d3\u30eb\u30c9\u305b\u3059\u3001\u5404\u30da\u30fc\u30b8\u306b<code>Vue<\/code>\u306e\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u3068\u3044\u3046\u300c<strong>\u30b7\u30f3\u30d7\u30eb\u30fb\u30a6\u30a7\u30a4<\/strong>\u300d\u3092\u3057\u305f\u304f\u306a\u3063\u305f\u3093\u3067\u3059\u306d\u3002\uff08\u2190 \u3053\u308c\u3060\u3068\u304d\u3063\u3068\u4f1a\u793e\u3082\u6280\u8853\u8005\u3092\u63a1\u7528\u3057\u3084\u3059\u3044\u306f\u305a\uff01\uff09<\/p>\n<p>\u203b <code>Alpine.js<\/code>\u3082\u3042\u308a\u306a\u3093\u3067\u3059\u304c\u3001\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u591a\u7528\u3059\u308b\u5834\u5408\u306f<code>Vue<\/code>\u306e\u65b9\u304c\u3044\u3044\u304b\u306a\u3068\u3044\u3046\u5370\u8c61\u3067\u3057\u305f\u3002<\/p>\n<p>\u305d\u3053\u3067\u2757<\/p>\n<p>\u4eca\u56de\u306f\u300c<strong>Laravel Breeze + Vue 3\uff08\u3067\u3082\u3001Inertia\u306f\u629c\u304d\u306d\uff09<\/strong>\u300d\u3068\u3044\u3046\u958b\u767a\u74b0\u5883\u3092\u4f5c\u3063\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u305c\u3072\u4f55\u304b\u306e\u53c2\u8003\u306b\u306a\u308a\u307e\u3057\u305f\u3089\u5b09\u3057\u3044\u3067\u3059\ud83d\ude04\u2728<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6066 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/03\/no_23.png\" alt=\"\" width=\"370\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/03\/no_23.png 370w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/03\/no_23-300x259.png 300w\" sizes=\"auto, (max-width: 370px) 100vw, 370px\" \/>\u300c\u79c1\u306e\u81ea\u8ee2\u8eca\u306f\u6bb5\u5207\u308a\u66ff\u3048\u304c<br \/>\n\u3064\u3044\u3066\u307e\u305b\u3093\u304c\u3001<br \/>\n\u79c1\u306e\u8db3\u306b\u306f\u3064\u3044\u3066\u307e\u3059\u3002\uff13\u6bb5\u968e\u306d\ud83d\udc4d\u300d<\/p>\n<h1>\u3084\u308a\u305f\u3044\u3053\u3068<\/h1>\n<p>\u4eca\u56de\u306f\u3084\u308a\u305f\u3044\u3053\u3068\u3092\u4ee5\u4e0b\u306b\u307e\u3068\u3081\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<ul>\n<li>Laravel Breeze\u3067\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd \uff06 Vue 3 \u304c\u4f7f\u3048\u308b\u3088\u3046\u306b\u3059\u308b<\/li>\n<li>\u305f\u3060\u3057\u3001Inertia.js \u306f\u4f7f\u308f\u306a\u3044<\/li>\n<li>\u3064\u307e\u308a\u3001vite \u306f js \u3084 css \u3092\u3072\u3068\u3064\u306b\u307e\u3068\u3081\u308b\u3060\u3051\u306b\u4f7f\u3046\uff08watch \u3082\u4f7f\u308f\u306a\u3044\uff09<\/li>\n<li>\u3067\u3082\u3001axios \u3068\u304b TailwindCSS \u306f\u4f7f\u3044\u305f\u3044<\/li>\n<\/ul>\n<p>\u3064\u307e\u308a\u3001\u3068\u306b\u304b\u304f<code>Inertia.js<\/code>\u3092\u9664\u5916\u3057\u305f\u3044\u3068\u3044\u3046\u30d1\u30bf\u30fc\u30f3\u3067\u3059\u3002\uff08\u30b3\u30ec\u3001\u9700\u8981\u3042\u308b\u306e\u304b\u3061\u3087\u3063\u3068\u5fc3\u914d\u3067\u3059\u306d\u2026\ud83d\ude02\uff09<\/p>\n<h1>\u524d\u63d0\u3068\u3057\u3066<\/h1>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001<code>Laravel Breeze<\/code>\u3067\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u3066\u3001\u3055\u3089\u306b\u305d\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c<code>Vue<\/code>\u30d1\u30bf\u30fc\u30f3\u3067\u3042\u308b\u3053\u3068\u304c\u524d\u63d0\u3067\u3059\u3002<\/p>\n<p>\u3064\u307e\u308a\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u304c\u5b9f\u884c\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u304c\u524d\u63d0\u3067\u3059\u3002<\/p>\n<pre><strong>composer require laravel\/breeze --dev\r\n\r\n# \ud83d\udc47 \u3053\u3053\r\nphp artisan breeze:install vue\r\n\r\nphp artisan migrate\r\nnpm install\r\nnpm run dev\r\n<\/strong><\/pre>\n<p>\u3067\u306f\u3001\u4eca\u56de\u3082\u697d\u3057\u304f\u3084\u3063\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u2757<\/p>\n<h1>Vite \u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u5909\u66f4\u3059\u308b<\/h1>\n<p>\u307e\u305a\u3001<code>Inertia<\/code>\u629c\u304d\u306e<code>vue<\/code>\u3092\u4f7f\u3046\u3068\u304d\u306b\u554f\u984c\u306b\u306a\u308b\u306e\u304c\u300c<strong>\u30d3\u30eb\u30c9\u65b9\u6cd5<\/strong>\u300d\u3001\u3064\u307e\u308a<code>vite<\/code>\u306e\u8a2d\u5b9a\u3067\u3059\u3002\uff08\u3064\u307e\u308a\u3001\u30d3\u30eb\u30c9\u81ea\u4f53\u306f\u4f7f\u3044\u307e\u3059\uff09<\/p>\n<p>\u305d\u3053\u3067\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u5909\u66f4\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><strong>vite.config.js<\/strong><\/p>\n<pre>import { defineConfig } from 'vite';\r\nimport laravel from 'laravel-vite-plugin';\r\nimport vue from '@vitejs\/plugin-vue';\r\n\r\nexport default defineConfig({\r\n    plugins: [\r\n        laravel({\r\n            input: <strong>[ \/\/ \ud83d\udc48 \u3053\u3053\u3092\u5909\u66f4\u3057\u307e\u3057\u305f\r\n                'resources\/css\/app.css',\r\n                'resources\/js\/app.js',\r\n            ]<\/strong>,\r\n            refresh: true,\r\n        }),\r\n        vue({\r\n            template: {\r\n                transformAssetUrls: {\r\n                    base: null,\r\n                    includeAbsolute: false,\r\n                },\r\n            },\r\n        }),\r\n    ],\r\n    <strong>resolve: { \/\/ \ud83d\udc48 \u3053\u3053\u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f\r\n        alias: {\r\n            vue: 'vue\/dist\/vue.esm-browser.prod.js',\r\n        },\r\n    },<\/strong>\r\n});\r\n\r\n<\/pre>\n<h1>app.js \u3092\u5909\u66f4\u3059\u308b<\/h1>\n<p>\u6b21\u306b\u3001\u30d3\u30eb\u30c9\u3059\u308b\u969b\u306b\u4f7f\u308f\u308c\u308b<code>app.js<\/code>\u3092\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n<p>\u300c<strong>Vue + Inertia<\/strong>\u300d\u30d1\u30bf\u30fc\u30f3\u3067<code>Laravel Breeze<\/code>\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3068\u3001\u3053\u306e\u4e2d\u306b\u306f<code>Inertia<\/code>\u306e\u8a2d\u5b9a\u30b3\u30fc\u30c9\u304c\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u304c\u4e0d\u8981\u306a\u306e\u3067\u5168\u524a\u9664\u3057\u307e\u3059\u3002<\/p>\n<pre>import '.\/bootstrap';\r\nimport '..\/css\/app.css';\r\n\r\n<strong>import { createApp } from 'vue';<\/strong>\r\n<strong>window.createApp = createApp;<\/strong>\r\n\r\n\/\/ \u5143\u304b\u3089\u3042\u308b\u3001\u3053\u308c\u4ee5\u964d\u306e\u30b3\u30fc\u30c9\u306f\u3059\u3079\u3066\u524a\u9664 or \u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8<\/pre>\n<p>\u3061\u306a\u307f\u306b\u3001<code>bootstrap<\/code>\u304c\u8aad\u307f\u8fbc\u307e\u308c\u3066\u3044\u308b\u306e\u3067\u3001\u3044\u3064\u3082\u3069\u304a\u308a<code>axios<\/code>\u3082\u4f7f\u3048\u307e\u3059\u2757<\/p>\n<p>\u307e\u305f\u3001<code>css<\/code>\u306b\u95a2\u3057\u3066\u306f\u4eca\u56de\u306f\u5909\u66f4\u3059\u308b\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\u304c\u3001\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u308a\u3001\u6539\u9020\u3057\u305f\u3044\u5834\u5408\u306f\u540c\u69d8\u306b\u4ee5\u4e0b\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u5909\u66f4\u3057\u3066<code>vite<\/code>\u3067\u30d3\u30eb\u30c9\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>resources\/css\/app.css\r\n<\/strong><\/pre>\n<h1>\u72ec\u81ea\u306eBlade\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u3092\u3064\u304f\u308b<\/h1>\n<p>\u3053\u308c\u306f\u6b21\u306e\u9805\u76ee\u3067\u4f7f\u3046\u306e\u3067\u3059\u304c\u3001\u300c<strong>Vue + Inertia<\/strong>\u300d\u30d1\u30bf\u30fc\u30f3\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3068<code>@vite()<\/code>\u3068\u3044\u3046\u30c7\u30a3\u30ec\u30af\u30c6\u30a3\u30d6\u3092<code>Blade<\/code>\u30d5\u30a1\u30a4\u30eb\u5185\u3067\u547c\u3073\u51fa\u3059\u3068\u300c<strong>js \u3084 css \u306e\u30bf\u30b0\u3092\u7528\u610f\u3057\u3066\u304f\u308c\u308b<\/strong>\u300d\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u305f\u3060\u3001\u3053\u308c\u304c\u5384\u4ecb\u306a\u3093\u3067\u3059\u2026<\/p>\n<p>\u3068\u3044\u3046\u306e\u3082\u3001\u3053\u306e<code>@vite<\/code>\u3092\u547c\u3073\u51fa\u3057\u305f\u5834\u5408\u306e<code>JavaScript<\/code>\u7528\u30bf\u30b0\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u300c<strong>preload<\/strong>\u300d\u300c<strong>modulepreload<\/strong>\u300d\u300c<strong>module<\/strong>\u300d\u3068\u3044\u3063\u305f\u901a\u5e38\u306e\u547c\u3073\u51fa\u3057\u65b9\u3067\u306f\u306a\u3044\u305f\u3081\u5b9f\u884c\u304c\u3067\u304d\u306a\u3044\u306e\u3067\u3059\u3002<\/p>\n<pre>&lt;link rel=\"<strong>preload<\/strong>\" as=\"style\" href=\"http:\/\/vue-build.test\/build\/assets\/app-ee30c653.css\" \/&gt;\r\n&lt;link rel=\"<strong>modulepreload<\/strong>\" href=\"http:\/\/vue-build.test\/build\/assets\/app-346cb035.js\" \/&gt;\r\n&lt;link rel=\"stylesheet\" href=\"http:\/\/vue-build.test\/build\/assets\/app-ee30c653.css\" \/&gt;\r\n&lt;script type=\"<strong>module<\/strong>\" src=\"http:\/\/vue-build.test\/build\/assets\/app-346cb035.js\"&gt;&lt;\/script&gt;\r\n<\/pre>\n<p>\u305d\u3053\u3067\u3001\u300c<strong>\u3053\u306e\u30bf\u30b0\u306e\u4ee3\u308f\u308a\u3092\u72ec\u81ea\u306b\u3064\u304f\u3063\u3061\u3083\u304a\u3046\u2757<\/strong>\u300d\u3068\u3044\u3046\u306e\u304c\u3053\u306e\u9805\u76ee\u306e\u76ee\u7684\u3067\u3059\u3002<\/p>\n<p>\u3067\u306f\u3001\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3092\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><strong>app\/Providers\/AppServiceProvider.php<\/strong><\/p>\n<pre>&lt;?php\r\n\r\nnamespace App\\Providers;\r\n\r\n<strong>use Illuminate\\Support\\Facades\\Blade; \/\/ \ud83d\udc48 \u3053\u3053\u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f<\/strong>\r\nuse Illuminate\\Support\\ServiceProvider;\r\n\r\nclass AppServiceProvider extends ServiceProvider\r\n{\r\n    \/**\r\n     * Register any application services.\r\n     *\/\r\n    public function register(): void\r\n    {\r\n        \/\/\r\n    }\r\n\r\n    \/**\r\n     * Bootstrap any application services.\r\n     *\/\r\n    public function boot(): void\r\n    {\r\n        \/\/ \ud83d\udc47 \u3053\u3053\u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f\r\n        <strong>Blade::directive('assets', function (string $expression) {<\/strong>\r\n\r\n<strong>            $manifest_path = public_path('build\/manifest.json');<\/strong>\r\n\r\n<strong>            return '<\/strong>\r\n<strong>                &lt;?php<\/strong>\r\n\r\n<strong>                    $manifest_data = json_decode(<\/strong>\r\n<strong>                        file_get_contents(\"'. $manifest_path .'\"),<\/strong>\r\n<strong>                        true<\/strong>\r\n<strong>                    );<\/strong>\r\n<strong>                    echo \"&lt;script src=\\\\\"\/build\/\". $manifest_data[\"resources\/js\/app.js\"][\"file\"] .\"\\\\\"&gt;&lt;\/script&gt;\";<\/strong>\r\n<strong>                    echo \"&lt;link rel=\\\\\"stylesheet\\\\\" href=\\\\\"\/build\/\". $manifest_data[\"resources\/js\/app.js\"][\"css\"][0] .\"\\\\\"&gt;\";<\/strong>\r\n\r\n<strong>                ?&gt;<\/strong>\r\n<strong>            ';<\/strong>\r\n\r\n<strong>        });<\/strong>\r\n    }\r\n}<\/pre>\n<p><strong>\u3010\u8ffd\u8a18\uff1a2023.10.10\u3011<\/strong><br \/>\n\u4ee5\u524d\u306e\u30b3\u30fc\u30c9\u3067\u306f\u30d3\u30eb\u30c9\u3057\u3066\u3082\u30d3\u30e5\u30fc\u306b\u30ad\u30e3\u30c3\u30b7\u30e5\u304c\u6b8b\u3063\u3066\u3057\u307e\u3044\u3001\u5909\u66f4\u304c\u9069\u7528\u3055\u308c\u306a\u3044\u306e\u3067\u5909\u66f4\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u3064\u307e\u308a\u3001<code>storage\/framework\/views<\/code>\u30d5\u30a9\u30eb\u30c0\u5185\u306b\u5b9f\u969b\u306b\u51fa\u529b\u3055\u308c\u308b\u30ad\u30e3\u30c3\u30b7\u30e5\u7528\u306e\u30b3\u30fc\u30c9\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002\uff08\u3053\u308c\u306a\u3089\u6bce\u56de\u30c7\u30fc\u30bf\u53d6\u5f97\u3059\u308b\u306e\u3067\u30ad\u30e3\u30c3\u30b7\u30e5\u3055\u308c\u308b\u3053\u3068\u306f\u3042\u308a\u307e\u305b\u3093\ud83d\udc4d\uff09<\/p>\n<div>\n<pre>&lt;?php\r\n\r\n    <strong>$manifest_data = json_decode(<\/strong>\r\n<strong>        file_get_contents(\"\uff08Laravel\u307e\u3067\u306e\u30d1\u30b9\uff09\/public\/build\/manifest.json\"),<\/strong>\r\n<strong>        true<\/strong>\r\n<strong>    );<\/strong>\r\n<strong>    echo \"&lt;script src=\\\"\/build\/\". $manifest_data[\"resources\/js\/app.js\"][\"file\"] .\"\\\"&gt;&lt;\/script&gt;\";<\/strong>\r\n<strong>    echo \"&lt;link rel=\\\"stylesheet\\\" href=\\\"\/build\/\". $manifest_data[\"resources\/js\/app.js\"][\"css\"][0] .\"\\\"&gt;\";<\/strong>\r\n\r\n?&gt;<\/pre>\n<\/div>\n<p>\u3053\u308c\u3067\u3001<code>@assets<\/code>\u304c<code>Blade<\/code>\u5185\u3067\u4f7f\u3048\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>\u307e\u305f\u3001\u30d3\u30eb\u30c9\u3059\u308b\u305f\u3073\u306b\u30e9\u30f3\u30c0\u30e0\u306b\u30d5\u30a1\u30a4\u30eb\u540d\u304c\u5909\u308f\u308a\u307e\u3059\u304c\u3001<code>public\/build\/manifest.json<\/code>\u304b\u3089\u6700\u65b0\u306e\u30d5\u30a1\u30a4\u30eb\u540d\u3092\u53d6\u5f97\u3057\u3066\u3044\u308b\u306e\u3067\u4f55\u5ea6\u30d3\u30eb\u30c9\u3057\u306a\u304a\u3057\u3066\u3082\u554f\u984c\u306f\u3042\u308a\u307e\u305b\u3093\ud83d\udc4d<\/p>\n<h1>\u30ec\u30a4\u30a2\u30a6\u30c8\u30d5\u30a1\u30a4\u30eb\u3092\u3064\u304f\u308b<\/h1>\n<p>\u7d9a\u3044\u3066\u3001\u300c<strong>Vue + Inertia<\/strong>\u300d\u3067\u306f\u5b58\u5728\u3057\u3066\u3044\u306a\u3044<code>Blade<\/code>\u306e\u300c<strong>\u30ec\u30a4\u30a2\u30a6\u30c8\u30d5\u30a1\u30a4\u30eb<\/strong>\u300d\u3092\u4f5c\u6210\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><strong>resources\/views\/layouts\/app.blade.php<\/strong><\/p>\n<pre><strong>&lt;!DOCTYPE html&gt;\r\n&lt;html lang=\"{{ str_replace('_', '-', app()-&gt;getLocale()) }}\"&gt;\r\n&lt;head&gt;\r\n    &lt;meta charset=\"utf-8\"&gt;\r\n    &lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"&gt;\r\n\r\n    &lt;title&gt;{{ config('app.name', 'Laravel') }}&lt;\/title&gt;\r\n\r\n    &lt;!-- Fonts --&gt;\r\n    &lt;link rel=\"preconnect\" href=\"https:\/\/fonts.bunny.net\"&gt;\r\n    &lt;link href=\"https:\/\/fonts.bunny.net\/css?family=figtree:400,500,600&amp;display=swap\" rel=\"stylesheet\" \/&gt;\r\n\r\n    &lt;!-- Scripts --&gt;\r\n    @assets\r\n&lt;\/head&gt;\r\n&lt;body class=\"font-sans antialiased\"&gt;\r\n\r\n    @yield('content')\r\n    @yield('script')\r\n\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/strong><\/pre>\n<p>\u3053\u308c\u3067\u300c<strong>Inertia \u629c\u304d<\/strong>\u300d\u3067<code>Vue 3<\/code>\u3092\u4f7f\u3046\u6e96\u5099\u304c\u5b8c\u4e86\u3057\u307e\u3057\u305f\u2757<\/p>\n<h1>\u30d3\u30e5\u30fc\uff06\u30eb\u30fc\u30c8\u3092\u3064\u304f\u308b<\/h1>\n<p>\u3067\u306f\u3001\u6700\u671f\u306b\u30c6\u30b9\u30c8\u7528\u306e\u30d3\u30e5\u30fc\u3068\u30eb\u30fc\u30c8\u3092\u4f5c\u3063\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><strong>resources\/views\/vue_without_inertia.blade.php<\/strong><\/p>\n<pre><strong>@extends('layouts.app')\r\n\r\n@section('content')\r\n\r\n    &lt;div id=\"app\" class=\"p-5\"&gt;\r\n        &lt;div class=\"bg-red-500 p-1\" v-text=\"greeting\"&gt;&lt;\/div&gt;\r\n    &lt;\/div&gt;\r\n\r\n@endsection\r\n\r\n@section('script')\r\n\r\n    &lt;script&gt;\r\n\r\n        createApp({\r\n            data() {\r\n                return {\r\n                    greeting: '\u304a\u3063\u306f\u3088\uff01'\r\n                }\r\n            },\r\n        }).mount('#app');\r\n\r\n    &lt;\/script&gt;\r\n\r\n@endsection\r\n<\/strong><\/pre>\n<p>\u304a\u6c17\u3065\u304d\u306e\u3068\u304a\u308a\u3001\u3053\u306e\u30b3\u30fc\u30c9\u306f<code>Inertia<\/code>\u306f\u4f7f\u3063\u3066\u3044\u307e\u305b\u3093\u3057\u3001\u4f55\u306a\u3089<code>Vue 2<\/code>\u5f62\u5f0f\u3067\u66f8\u3044\u3066\u3044\u308b\u306e\u3067\u300c<strong>\u30b7\u30f3\u30d7\u30eb\uff06\u5f37\u529b<\/strong>\u300d\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001\u4ee5\u4e0b\u306e\u30eb\u30fc\u30c8\u3082\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><strong>routes\/web.php<\/strong><\/p>\n<pre><strong>Route::get('vue_without_inertia', fn() =&gt; view('vue_without_inertia'));\r\n<\/strong><\/pre>\n<p>\u306f\u3044\u2757<br \/>\n\u3053\u308c\u3067\u3059\u3079\u3066\u306e\u4f5c\u696d\u304c\u5b8c\u4e86\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u304a\u75b2\u308c\u69d8\u3067\u3057\u305f\ud83d\ude04\u2728<\/p>\n<h1>\u304a\u307e\u3051\uff1a HTML\u306e\u30b3\u30fc\u30c9\u304c\u5909\u66f4\u3055\u308c\u306a\u3044\u6cbc\u306b\u306f\u307e\u3063\u305f\u3089<\/h1>\n<p>\u304a\u305d\u3089\u304f\u30b7\u30f3\u30d7\u30eb\u306b\u30ad\u30e3\u30c3\u30b7\u30e5\u304c\u52b9\u3044\u3066\u308b\u3060\u3051\u3067\u3059\u3002<br \/>\n\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002\uff08\u5b9f\u306f\u30b3\u30ec\u3001\u79c1\u3067\u3059\u2026\ud83d\ude05\uff09<\/p>\n<pre><strong>php artisan view:clear<\/strong><\/pre>\n<h1>\u30c6\u30b9\u30c8\u3057\u3066\u307f\u308b<\/h1>\n<p>\u3067\u306f\u3001\u5b9f\u969b\u306b\u30c6\u30b9\u30c8\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u2757<\/p>\n<p>\u307e\u305a\u306f<code>vite<\/code>\u3067\u30d3\u30eb\u30c9\u3057\u307e\u3059\u3002<br \/>\n\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>npm run build\r\n<\/strong><\/pre>\n<p>\u3059\u308b\u3068\u3001\u81ea\u52d5\u3067<code>vite<\/code>\u304c\u3044\u3044\u611f\u3058\u306b<code>js<\/code>\u3001<code>css<\/code>\u30d5\u30a1\u30a4\u30eb\u3092\u4e00\u3064\u306b\u56fa\u3081\u3066\u304f\u308c\u307e\u3059\u3002\uff08<code>vite<\/code>\u65e9\u3044\u3067\u3059\u306d\ud83d\udc4d\uff09<\/p>\n<p>\u3067\u306f\u3001\u3053\u306e\u72b6\u614b\u3067\u30d6\u30e9\u30a6\u30b6\u3092\u4f7f\u3044\u3001\u300c<strong>https:\/\/******\/vue_without_inertia<\/strong>\u300d\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u3069\u3046\u306a\u308b\u3067\u3057\u3087\u3046\u304b\u30fb\u30fb\u30fb\u30fb\u30fb\u30fb<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11866\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2023\/07\/laravel_vue_without_inertia_1.png\" alt=\"\" width=\"312\" height=\"74\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2023\/07\/laravel_vue_without_inertia_1.png 312w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2023\/07\/laravel_vue_without_inertia_1-300x71.png 300w\" sizes=\"auto, (max-width: 312px) 100vw, 312px\" \/><\/p>\n<p>\u306f\u3044\u2757\u300c<strong>\u304a\u3063\u306f\u3088\uff01<\/strong>\u300d\u3068\u3044\u3046\u30c6\u30ad\u30b9\u30c8\u306f<code>JavaScript<\/code>\u5185\u306b\u3042\u308a\u307e\u3057\u305f\u304c\u3001<code>Vue<\/code>\u306b\u3088\u3063\u3066\u8868\u793a\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3059\u3079\u3066\u6210\u529f\u3067\u3059\ud83d\ude04\u2728<\/p>\n<h1>\u4f01\u696d\u69d8\u3078\u306e\u3054\u63d0\u6848<\/h1>\n<p>\uff082023.7.20 \u73fe\u5728\u306e\uff09<code>Laravel Breeze<\/code>\u3067\u306f<code>Vue<\/code>\u3092\u4f7f\u304a\u3046\u3068\u3059\u308b\u3068\u3001\u81ea\u52d5\u7684\u306b<code>Inertia<\/code>\u3068\u7d71\u5408\u3055\u308c\u3066\u3057\u307e\u3046\u305f\u3081\u3001\u305d\u308c\u307e\u3067\u57f9\u3063\u305f<code>Vue<\/code>\u306e\u30b3\u30fc\u30c9\u306e\u66f8\u304d\u65b9\u3092\u6839\u672c\u7684\u306b\u5909\u66f4\u305b\u3056\u308b\u3092\u5f97\u306a\u3044\u72b6\u6cc1\u3067\u3057\u305f\u3002<\/p>\n<p>\u3057\u304b\u3057\u3001\u4eca\u56de\u306e\u30c6\u30af\u30cb\u30c3\u30af\u3092\u4f7f\u3046\u3053\u3068\u3067\u904e\u53bb\u306e\u30b3\u30fc\u30c9\u3092\u518d\u5229\u7528\u3057\u3084\u3059\u304f\u306a\u308a\u307e\u3059\u3057\u3001\u306a\u306b\u3088\u308a\u79fb\u884c\u306b\u3042\u305f\u3063\u3066\u5b66\u7fd2\u30b3\u30b9\u30c8\u306f\u307b\u3068\u3093\u3069\u767a\u751f\u3057\u307e\u305b\u3093\u3002<\/p>\n<p>\u3082\u3057\u3001\u305d\u3046\u3044\u3063\u305f\u72b6\u6cc1\u3067\u304a\u56f0\u308a\u3067\u3057\u305f\u3089\u3044\u3064\u3067\u3082\u304a\u6c17\u8efd\u306b\u3054\u76f8\u8ac7\u304f\u3060\u3055\u3044\u3002<br \/>\n\u304a\u5f85\u3061\u3057\u3066\u304a\u308a\u307e\u3059\u3002\ud83d\ude04\u2728<\/p>\n<h1>\u304a\u308f\u308a\u306b<\/h1>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u4eca\u56de\u306f\u300c<strong>Laravel + Vue\uff08Inertia \u629c\u304d\uff09<\/strong>\u300d\u306e\u74b0\u5883\u3092\u3064\u304f\u3063\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p>\u3082\u3061\u308d\u3093\u300c<strong>Vue + Inertia<\/strong>\u300d\u3092\u4f7f\u3046\u5834\u5408\u306e\u30e1\u30ea\u30c3\u30c8\u3082\u305f\u304f\u3055\u3093\u3042\u308b\u3068\u306f\u601d\u3046\u306e\u3067\u3059\u304c\u3001\u30b7\u30f3\u30d7\u30eb\u306b\u3044\u304d\u305f\u3044\u5834\u5408\u306f\u78ba\u5b9f\u306b\u30aa\u30fc\u30d0\u30fc\u30b9\u30da\u30c3\u30af\u306b\u306a\u308b\u306e\u3067\u3001\u9078\u5225\u304c\u96e3\u3057\u3044\u3068\u3053\u308d\u3067\u3059\u306d\u3002<\/p>\n<p>\u305d\u3046\u8003\u3048\u308b\u3068\u3001<code>Laravel Breeze<\/code>\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3068\u304d\u300c<strong>vue<\/strong>\u300d\u306b\u300c<strong>&#8211;no-inertia<\/strong>\u300d\u307f\u305f\u3044\u306a\u9078\u629e\u80a2\u3092\u7528\u610f\u3057\u3066\u304f\u308c\u308b\u3068\u5b09\u3057\u3044\u3093\u3067\u3059\u3051\u3069\u3001\u591a\u5206\u30d7\u30eb\u30ea\u30af\u30a8\u30b9\u30c8\u3057\u3066\u3082\u62d2\u5426\u3055\u308c\u305d\u3046\u3067\u3059\u306d\ud83d\ude02<\/p>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u305c\u3072\u7686\u3055\u3093\u3082\u3084\u3063\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u306d\u3002<\/p>\n<p>\u3067\u306f\u3067\u306f\u301c\u2757<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11826 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2023\/06\/no_16_old.png\" alt=\"\" width=\"370\" height=\"310\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2023\/06\/no_16_old.png 370w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2023\/06\/no_16_old-300x251.png 300w\" sizes=\"auto, (max-width: 370px) 100vw, 370px\" \/>\u300c\u9031\u672b\u306f\u671d\u304b\u3089<br \/>\n\u51fa\u304b\u3051\u308b\u5f71\u97ff\u3067\u3001<br \/>\n\u5915\u98df\u5f8c\u3068\u5bdd\u3061\u3083\u3044\u307e\u3059\ud83d\ude02\u300d<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u3053\u306e\u9593\u30c4\u30a4\u30c3\u30bf\u30fc\u3092\u773a\u3081\u3066\u3044\u308b\u3068\u00a0Vue3\u306e\u8870\u9000\u3092\u62db\u3044\u305f\u306e\u306f&lt;script setup&gt;\u3068CompositionAPI\u304b\u3082\u3057\u308c\u306a\u3044 \u3068\u3044\u3046\u8003 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.capilano-fw.com\/?p=11865\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;Inertia\u3092\u9664\u5916\uff01Laravel Breeze + Vue 3\u3067\u300c\u3042\u306e\u9803\u306e\u3088\u3046\u306a\u300d\u30b7\u30f3\u30d7\u30eb\u958b\u767a\u3059\u308b\u65b9\u6cd5&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":11871,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[247,3,12],"tags":[],"class_list":["post-11865","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-inertia-js","category-laravel","category-vue-js"],"_links":{"self":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/11865","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=11865"}],"version-history":[{"count":9,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/11865\/revisions"}],"predecessor-version":[{"id":12090,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/11865\/revisions\/12090"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/media\/11871"}],"wp:attachment":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=11865"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=11865"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=11865"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}