{"id":10845,"date":"2022-08-29T07:00:55","date_gmt":"2022-08-28T22:00:55","guid":{"rendered":"https:\/\/blog.capilano-fw.com\/?p=10845"},"modified":"2023-02-15T02:48:54","modified_gmt":"2023-02-14T17:48:54","slug":"%e3%80%90laravel%e3%80%91vite-inertia-react-%e3%81%a7%e3%83%ad%e3%82%b0%e3%82%a4%e3%83%b3%e6%a9%9f%e8%83%bd%e3%82%92%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"https:\/\/blog.capilano-fw.com\/?p=10845","title":{"rendered":"\u3010Laravel\u3011Vite + Inertia + React \u3067\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b"},"content":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u3053\u308c\u306f\u7686\u3055\u3093\u3082\u611f\u3058\u308b\u3053\u3068\u3060\u3068\u601d\u3046\u306e\u3067\u3059\u304c\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u4e16\u754c\u306f\u66f4\u65b0\u304c\u30db\u30f3\u30c8\u306b\u65e9\u3044\u306e\u3067\u3001\u5e38\u306b\u4e16\u306e\u4e2d\u306e\u6d41\u308c\u3092\u611f\u3058\u3066\u3044\u306a\u3044\u3068\u3059\u3050\u53e4\u3044\u6280\u8853\uff06\u53e4\u3044\u8003\u3048\u65b9\u306b\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/p>\n<p>\u9000\u5c48\u3057\u306a\u3044\u306e\u3067\u3001\u500b\u4eba\u7684\u306b\u306f\u305d\u308c\u3067\u3044\u3044\u306e\u3067\u3059\u304c\u3001\u305d\u3046\u306a\u308b\u3068\u3072\u3068\u3064\u96e3\u3057\u3044\u70b9\u304c\u51fa\u3066\u304d\u305f\u308a\u3082\u3057\u307e\u3059\u3002<\/p>\n<p>\u305d\u308c\u306f\u30fb\u30fb\u30fb\u30fb\u30fb\u30fb<\/p>\n<p><strong style=\"font-size: 35px;\">\u73fe\u72b6\u306e\u6280\u8853\u3092\u3044\u3064\u6b62\u3081\u308b\u304b\uff1f\uff1f<\/strong><\/p>\n<p>\u3067\u3059\u3002<\/p>\n<p>\u3068\u3044\u3046\u306e\u3082\u3001\u300c<strong>\u30b7\u30f3\u30d7\u30eb\u306b<code>cdn<\/code>\u3060\u3051\u3067\u5b9f\u884c\u3067\u304d\u308b<\/strong>\u300d\u3088\u3046\u306b\u3057\u305f\u3044\u306e\u3067\u3001\u3053\u306e\u30d6\u30ed\u30b0\u3067\u306f\u305a\u3063\u3068<code>Vue<\/code>\u3092\u63a1\u7528\u3057\u3066\u304d\u307e\u3057\u305f\u3002<\/p>\n<p>\u3057\u304b\u3057\u3001<code>Vue 3<\/code>\u306b\u306a\u3063\u3066\u304b\u3089\u300c\u3046\u30fc\u3093\u2026\u300d\u3068\u601d\u3046\u3053\u3068\u304c\u591a\u304f\u306a\u308a\u3001\u3055\u3089\u306b\u300c<strong>Vue \u2192 React<\/strong>\u300d\u306e\u6d41\u308c\u304c\u51fa\u3066\u304d\u3066\u3044\u308b\u3088\u3046\u306a\u6c17\u304c\u3057\u3066\u3044\u308b\u306e\u3067\u3001\u79c1\u3082\u305d\u308c\u306b\u4e57\u3063\u304b\u308d\u3046\u304b\u3068\u8003\u3048\u3066\u3044\u305f\u3093\u3067\u3059\u306d\u3002<\/p>\n<p>\u307e\u305f\u3001<code>Vite<\/code>\u304c<code>Laravel<\/code>\u306b\u6a19\u6e96\u642d\u8f09\u3055\u308c\u3066\u5909\u66f4\u304c\u3059\u3050\u30da\u30fc\u30b8\u306b\u53cd\u6620\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u3063\u305f\u306e\u3082\u7406\u7531\u306e\u3072\u3068\u3064\u3067\u3059\u3002<\/p>\n<p>\uff08\u5b9f\u969b\u306f\u307e\u3060\u304a\u8a66\u3057\u611f\u899a\u306a\u306e\u3067\u3001\u3059\u3050\u623b\u3059\u304b\u3082\u3067\u3059\u304c\u2026\ud83e\udd14\uff09<\/p>\n<p>\u305d\u3053\u3067\u2757<\/p>\n<p>\u4eca\u56de\u306f\u4eca\u5f8c\u306e\u8a18\u4e8b\u304b\u3089\u53c2\u7167\u3067\u304d\u308b\u3088\u3046\u306b\u3001\u300c<strong>Vite + Inertia + React<\/strong>\u300d\u3067\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u304c\u4f7f\u3048\u308b\u3088\u3046\u306b\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p>\u305c\u3072\u4f55\u304b\u306e\u53c2\u8003\u306b\u306a\u308c\u3070\u5b09\u3057\u3044\u3067\u3059\u3002\ud83d\ude0a\u2728<\/p>\n<p><strong>\u3010\u8ffd\u8a18\uff1a2023.2.15\u3011<\/strong><code>Laravel 10.x<\/code> \u3067\u3082\u3053\u306e\u8a18\u4e8b\u306e\u3084\u308a\u65b9\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u304d\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u307e\u3057\u305f\ud83d\udc4d<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10758 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/06\/no_21.png\" alt=\"\" width=\"370\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/06\/no_21.png 370w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/06\/no_21-300x259.png 300w\" sizes=\"auto, (max-width: 370px) 100vw, 370px\" \/>\u300c\u6691\u3059\u304e\u3066\u3001\u3068\u306a\u308a\u753a\u306b\u884c\u304f\u306e\u306b<br \/>\n\uff12\u56de\u304a\u5e97\u306b\u5165\u3063\u3066\u6dbc\u307f\u307e\u3057\u305f\ud83d\ude02\u300d<\/p>\n<p><strong>\u958b\u767a\u74b0\u5883\uff1a<\/strong> Laravel 9.x<\/p>\n<h1>Laravel \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b<\/h1>\n<p>\u4eca\u56de\u306f<code>Vite<\/code>\u304c\u6a19\u6e96\u642d\u8f09\u3055\u308c\u305f<code>Laravel<\/code>\u3092\u7528\u610f\u3057\u305f\u3044\u306e\u3067\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u90e8\u5206\u304b\u3089\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<p>\u3067\u306f\u3001\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u304b\u3089\u300c<strong>Laravel\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u3044\u30d5\u30a9\u30eb\u30c0<\/strong>\u300d\u3078\u79fb\u52d5\u3057\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u203b \u306a\u304a\u3001\u4eca\u56de\u306f\u300c\u30b5\u30fc\u30d0\u30fc\u30b5\u30a4\u30c9\u30fb\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u300d\u3092\u3059\u308b\u3064\u3082\u308a\u306a\u306e\u3067\u3001\u540d\u524d\u306f\u300c<strong>l9x-ssr<\/strong>\u300d\u306b\u3057\u307e\u3059\u304c\u3001\u3053\u3053\u306f\u304a\u597d\u307f\u3067\u5909\u66f4\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>composer create-project laravel\/laravel l9x-ssr<\/strong><\/pre>\n<p><code>Laravel<\/code>\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u5b8c\u4e86\u3057\u305f\u3089\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067\u30d5\u30a9\u30eb\u30c0\u6a29\u9650\u3092\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n<p>\u307e\u305a\u306f\u3001<code>cd<\/code>\u30b3\u30de\u30f3\u30c9\u3067<code>Laravel<\/code>\u306e\u4e2d\u306b\u79fb\u52d5\u3057\u3066\u30fb\u30fb\u30fb\u30fb<\/p>\n<pre><strong>cd l9x-ssr<\/strong><\/pre>\n<p>\u6a29\u9650\u3092\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n<pre><strong>sudo chmod 777 storage -R<\/strong><\/pre>\n<pre><strong>sudo chmod 777 bootstrap\/cache -R<\/strong><\/pre>\n<h1>.env \u306b\u8a2d\u5b9a\u3092\u66f8\u304d\u8fbc\u3080<\/h1>\n<p>\u7d9a\u3044\u3066\u3001<code>.env<\/code>\u30d5\u30a1\u30a4\u30eb\u306b\u305d\u308c\u305e\u308c\u8a2d\u5b9a\u3092\u66f8\u304d\u8fbc\u307f\u307e\u3059\u3002<\/p>\n<pre><strong>APP_URL=http:\/\/127.0.0.1:8000<\/strong><\/pre>\n<p>\u3053\u306e\u90e8\u5206\u306f\u3001<code>Vite<\/code>\u304b\u3089\u53c2\u7167\u3055\u308c\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u306e\u3067\u3001\u5b9f\u884c\u74b0\u5883\u306b\u5408\u308f\u305b\u3066\u5909\u66f4\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u4f8b\u3048\u3070\u3001<code>php artisan serve<\/code>\u3092\u5b9f\u884c\u3057\u3066\u8868\u793a\u3055\u308c\u308bURL\u304c\u3053\u308c\u306b\u8a72\u5f53\u3057\u307e\u3059\u3002<\/p>\n<p>\u203b \u79c1\u306e\u5834\u5408\u306f\u300c<strong>l9x-ssr.test<\/strong>\u300d\u3068\u3044\u3046\u958b\u767a\u7528\u306e\u5c02\u7528\u30c9\u30e1\u30a4\u30f3\u3092\u3064\u304f\u3063\u3066\u3044\u307e\u3059\u306e\u3067\u3001\u3053\u3053\u306f<code>https:\/\/l9x-ssr.test<\/code>\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u63a5\u7d9a\u60c5\u5831\u3082\u5fd8\u308c\u305a\u306b\u30bb\u30c3\u30c8\u3057\u3066\u304a\u3044\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>DB_DATABASE=l9x_ssr<\/strong>\r\n<strong>DB_USERNAME=\uff08\u3053\u3053\u306bDB\u30e6\u30fc\u30b6\u30fc\u540d\uff09<\/strong>\r\n<strong>DB_PASSWORD=\uff08\u3053\u3053\u306bDB\u30d1\u30b9\u30ef\u30fc\u30c9\uff09<\/strong><\/pre>\n<h1>Laravel Breeze \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b<\/h1>\n<p>\u6b21\u306b\u300c<strong>\u30b7\u30f3\u30d7\u30eb\u306a\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd<\/strong>\u300d\u304c\u4f7f\u3048\u308b\u3088\u3046\u306b\u306a\u308b\u30d1\u30c3\u30b1\u30fc\u30b8\u300c<strong>Laravel Breeze<\/strong>\u300d\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>composer require laravel\/breeze --dev<\/strong><\/pre>\n<p>\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u5b8c\u4e86\u3057\u305f\u3089\u3001\u4eca\u5ea6\u306f<code>React<\/code>&amp;<code>Inertia<\/code>\u304c\u4f7f\u3048\u308b\u3088\u3046\u306b\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067\u6e96\u5099\u3092\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>php artisan breeze:install react --ssr<\/strong><\/pre>\n<p>\u306a\u304a\u3001\u6700\u5f8c\u306e<code>--ssr<\/code>\u306f\u300c\u30b5\u30fc\u30d0\u30fc\u30b5\u30a4\u30c9\u30fb\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\uff08<code>node.js<\/code>\u3067<code>HTML<\/code>\u3092\u3064\u304f\u308b\u3084\u308a\u65b9\uff09\u300d\u3067\u30b5\u30a4\u30c8\u3092\u69cb\u7bc9\u3059\u308b\u3068\u3044\u3046\u610f\u5473\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u305d\u306e\u305f\u3081\u3001\u3082\u3057\u30d6\u30e9\u30a6\u30b6\u5074\u3067\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u3092\u3057\u305f\u3044\u5834\u5408\u306f\u524a\u9664\u3057\u3066\u304a\u3044\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001<code>npm<\/code>\u3067\uff08<code>React<\/code>\u306a\u3069\u306e\uff09\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3001\u305d\u308c\u3089\u3092\u8d77\u52d5\u3057\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>npm install &amp;&amp; npm run dev<\/strong><\/pre>\n<p>\u203b \u306a\u304a\u3001<code>npm run dev<\/code>\u306e\u3088\u3046\u306a\u3088\u304f\u4f7f\u3046\u30b3\u30de\u30f3\u30c9\u306f\u300c<strong>nrd<\/strong>\u300d\u306e\u3088\u3046\u306a\u30a8\u30a4\u30ea\u30a2\u30b9\u3092\u4f5c\u3063\u3066\u304a\u304f\u3068\u4f5c\u696d\u304c\u30e9\u30af\u306b\u306a\u308a\u307e\u3059\u3088\ud83d\udc4d\uff08\u3061\u3087\u3063\u3068<code>nrd<\/code>\u306e\u767a\u97f3\u7684\u306b\u306f\u3088\u308d\u3057\u304f\u306a\u3044\u304b\u3082\u3067\u3059\u304c\u2026\ud83d\ude02\uff09<\/p>\n<p>\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u8868\u793a\u306b\u306a\u308a\u307e\u3059\u306e\u3067<code>APP_URL<\/code>\u306b\u8868\u793a\u3055\u308c\u3066\u3044\u308b<code>URL<\/code>\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10846\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/08\/laravel_vite_inertia_react_1.png\" alt=\"\" width=\"411\" height=\"253\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/08\/laravel_vite_inertia_react_1.png 411w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/08\/laravel_vite_inertia_react_1-300x185.png 300w\" sizes=\"auto, (max-width: 411px) 100vw, 411px\" \/><\/p>\n<p>\u3061\u3087\u3063\u3068\u5206\u304b\u308a\u306b\u304f\u3044\u3067\u3059\u304c\u3001\u53f3\u4e0a\u306b<code>Log in<\/code>\u3068\u66f8\u304b\u308c\u3066\u3044\u308c\u3070\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306f\u6210\u529f\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10847\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/08\/laravel_vite_inertia_react_2.png\" alt=\"\" width=\"640\" height=\"355\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/08\/laravel_vite_inertia_react_2.png 640w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/08\/laravel_vite_inertia_react_2-300x166.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<h1>\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u306e\u6e96\u5099\u3092\u3059\u308b<\/h1>\n<p>\u3053\u306e\u6642\u70b9\u3067\u306f\u307e\u3060<code>DB<\/code>\u306b\u30e6\u30fc\u30b6\u30fc\u7ba1\u7406\u7528\u306e\u30c6\u30fc\u30d6\u30eb\u304c\u4f5c\u6210\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u306e\u3067\u3001\u3053\u306e\u90e8\u5206\u306e\u4f5c\u696d\u3092\u3057\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u307e\u305a\u306f\u3001\u30c6\u30b9\u30c8\u30c7\u30fc\u30bf\u3092\u8ffd\u52a0\u3059\u308b<code>Seeder<\/code>\u30d5\u30a1\u30a4\u30eb\u3092\u3064\u304f\u308a\u307e\u3059\u3002<\/p>\n<p>\u4e00\u65e6<code>Vite<\/code>\u306f\u300c<strong>Ctrl + C<\/strong>\u300d\u3067\u6b62\u3081\u308b\u304b\u3001\u5225\u306e\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u304b\u3089\u4ee5\u4e0b\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>php artisan make:seed UserSeeder<\/strong><\/pre>\n<p>\u3059\u308b\u3068\u3001\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u308b\u306e\u3067\u3001\u4e2d\u8eab\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u307e\u3059\u3002\uff08\u304a\u597d\u307f\u3067\u5909\u66f4\u3057\u3066\u304f\u3060\u3055\u3044\uff09<\/p>\n<p><strong>database\/seeders\/UserSeeder.php<\/strong><\/p>\n<pre>&lt;?php\r\n\r\nnamespace Database\\Seeders;\r\n\r\n<strong>use App\\Models\\User;<\/strong>\r\nuse Illuminate\\Database\\Console\\Seeds\\WithoutModelEvents;\r\nuse Illuminate\\Database\\Seeder;\r\n\r\nclass UserSeeder extends Seeder\r\n{\r\n    \/**\r\n     * Run the database seeds.\r\n     *\r\n     * @return void\r\n     *\/\r\n    public function run()\r\n    {\r\n        <strong>$names = [<\/strong>\r\n<strong>            'taro' =&gt; '\u592a\u90ce',<\/strong>\r\n<strong>            'jiro' =&gt; '\u6b21\u90ce',<\/strong>\r\n<strong>            'saburo' =&gt; '\u4e09\u90ce',<\/strong>\r\n<strong>            'shiro' =&gt; '\u56db\u90ce',<\/strong>\r\n<strong>            'goro' =&gt; '\u4e94\u90ce',<\/strong>\r\n<strong>            'rokuro' =&gt; '\u516d\u90ce',<\/strong>\r\n<strong>            'shichiro' =&gt; '\u4e03\u90ce',<\/strong>\r\n<strong>            'hachiro' =&gt; '\u516b\u90ce',<\/strong>\r\n<strong>            'kuro' =&gt; '\u4e5d\u90ce'<\/strong>\r\n<strong>        ];<\/strong>\r\n\r\n<strong>        foreach ($names as $name_en =&gt; $name_jp) {<\/strong>\r\n\r\n<strong>            User::create([<\/strong>\r\n<strong>                'name' =&gt; $name_jp,<\/strong>\r\n<strong>                'email' =&gt; $name_en .'@example.com',<\/strong>\r\n<strong>                'password' =&gt; bcrypt('xxxxxxxx')<\/strong>\r\n<strong>            ]);<\/strong>\r\n\r\n<strong>        }<\/strong>\r\n    }\r\n}<\/pre>\n<p><code>Seeder<\/code>\u30d5\u30a1\u30a4\u30eb\u306f\u4f5c\u6210\u3057\u305f\u3060\u3051\u3067\u306f\u5b9f\u884c\u3055\u308c\u307e\u305b\u3093\u306e\u3067\u3001<code>DatabaseSeeder.php<\/code>\u3078\u767b\u9332\u3057\u307e\u3059\u3002<\/p>\n<p><strong>database\/seeders\/DatabaseSeeder.php<\/strong><\/p>\n<pre>&lt;?php\r\n\r\nnamespace Database\\Seeders;\r\n\r\n\/\/ use Illuminate\\Database\\Console\\Seeds\\WithoutModelEvents;\r\nuse Illuminate\\Database\\Seeder;\r\n\r\nclass DatabaseSeeder extends Seeder\r\n{\r\n    \/**\r\n     * Seed the application's database.\r\n     *\r\n     * @return void\r\n     *\/\r\n    public function run()\r\n    {\r\n        <strong>$this-&gt;call(UserSeeder::class); \/\/ \ud83d\udc48 \u3053\u3053\u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f<\/strong>\r\n    }\r\n}<\/pre>\n<p>\u3067\u306f\u3001\u3053\u306e\u72b6\u614b\u3067\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u521d\u671f\u5316\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<br \/>\n\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>php artisan migrate:fresh --seed<\/strong><\/pre>\n<p>\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30c6\u30fc\u30d6\u30eb\u304c\u3044\u304f\u3064\u304b\u8ffd\u52a0\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10848\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/08\/laravel_vite_inertia_react_3.png\" alt=\"\" width=\"451\" height=\"412\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/08\/laravel_vite_inertia_react_3.png 451w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/08\/laravel_vite_inertia_react_3-300x274.png 300w\" sizes=\"auto, (max-width: 451px) 100vw, 451px\" \/><\/p>\n<p><code>users<\/code>\u30c6\u30fc\u30d6\u30eb\u306f\u3053\u3046\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10849\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/08\/laravel_vite_inertia_react_4.png\" alt=\"\" width=\"495\" height=\"471\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/08\/laravel_vite_inertia_react_4.png 495w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/08\/laravel_vite_inertia_react_4-300x285.png 300w\" sizes=\"auto, (max-width: 495px) 100vw, 495px\" \/><\/p>\n<p>\u3053\u308c\u3067\u4f5c\u696d\u306f\u3059\u3079\u3066\u5b8c\u4e86\u3067\u3059\u3002<br \/>\n\u304a\u75b2\u308c\u69d8\u3067\u3057\u305f\u2757<\/p>\n<h1>\u30c6\u30b9\u30c8\u3057\u3066\u307f\u308b<\/h1>\n<p>\u3067\u306f\u3001\u5b9f\u969b\u306b\u30ed\u30b0\u30a4\u30f3\u304c\u3067\u304d\u308b\u304b\u30c6\u30b9\u30c8\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u2757<\/p>\n<p>\u307e\u305a\u306f\u3001\uff08<code>Vite<\/code>\u304c\u6b62\u307e\u3063\u3066\u3044\u308b\u306a\u3089\uff09\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067\u518d\u5ea6\u8d77\u52d5\u3057\u307e\u3059\u3002<\/p>\n<pre><strong>npm run dev<\/strong><\/pre>\n<p>\u3067\u306f\u3001\u300c<strong>http:\/\/******\/login<\/strong>\u300d\u3078\u30a2\u30af\u30bb\u30b9\u3057\u3066\u3001\u300c<strong>\u592a\u90ce\u3055\u3093<\/strong>\u300d\u3067\u30ed\u30b0\u30a4\u30f3\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002\u30ed\u30b0\u30a4\u30f3\u60c5\u5831\u306f\u6b21\u306e\u3068\u304a\u308a\u3067\u3059\u3002<\/p>\n<ul>\n<li>Email: <strong>taro@example.com<\/strong><\/li>\n<li>Password: <strong>xxxxxxxx<\/strong><\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10850\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/08\/laravel_vite_inertia_react_5.png\" alt=\"\" width=\"492\" height=\"405\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/08\/laravel_vite_inertia_react_5.png 492w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/08\/laravel_vite_inertia_react_5-300x247.png 300w\" sizes=\"auto, (max-width: 492px) 100vw, 492px\" \/><\/p>\n<p>\u3059\u308b\u3068\u30fb\u30fb\u30fb\u30fb\u30fb\u30fb<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10851\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/08\/laravel_vite_inertia_react_6.png\" alt=\"\" width=\"640\" height=\"321\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/08\/laravel_vite_inertia_react_6.png 640w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/08\/laravel_vite_inertia_react_6-300x150.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>\u306f\u3044\u2757<\/p>\n<p>\u30da\u30fc\u30b8\u53f3\u4e0a\u306b\u592a\u90ce\u3055\u3093\u306e\u540d\u524d\u304c\u8868\u793a\u3055\u308c\u3001\u30ed\u30b0\u30a4\u30f3\u306b\u6210\u529f\u3057\u3066\u3044\u308b\u8868\u793a\u304c\u3067\u3066\u304d\u307e\u3057\u305f\u3002\u6210\u529f\u3067\u3059\ud83d\ude0a\u2728<\/p>\n<p>\u3067\u306f\u3001\u30da\u30fc\u30b8\u53f3\u4e0a\u304b\u3089\u30ed\u30b0\u30a2\u30a6\u30c8\u3067\u304d\u308b\u304b\u3082\u30c1\u30a7\u30c3\u30af\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10852\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/08\/laravel_vite_inertia_react_7.png\" alt=\"\" width=\"272\" height=\"123\" \/><\/p>\n<p>\u3069\u3046\u306a\u3063\u305f\u3067\u3057\u3087\u3046\u304b\u30fb\u30fb\u30fb\u30fb\u30fb\u30fb\uff1f\uff1f\uff1f<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-10853\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/08\/laravel_vite_inertia_react_8.png\" alt=\"\" width=\"640\" height=\"321\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/08\/laravel_vite_inertia_react_8.png 640w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/08\/laravel_vite_inertia_react_8-300x150.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>\u306f\u3044\u2757<br \/>\n\u30ed\u30b0\u30a2\u30a6\u30c8\u3055\u308c\u3066\u30c8\u30c3\u30d7\u30da\u30fc\u30b8\u306b\u623b\u3063\u3066\u304d\u307e\u3057\u305f\u3002<\/p>\n<p>\u5168\u3066\u6210\u529f\u3067\u3059\u3002\u2728\ud83d\ude0a\ud83d\udc4d<\/p>\n<h1>\u3061\u306a\u307f\u306b\uff1a\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306e\u5834\u6240<\/h1>\n<p>\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306f\u3001<code>resources\/js\/Pages<\/code>\u306e\u4e2d\u306b\u306f\u3044\u3063\u3066\u3044\u307e\u3059\u3002<br \/>\n<span style=\"font-size: 1rem;\"><code>React<\/code>\u3084<code>Inertia<\/code>\u306f\u3053\u306e\u4e2d\u3067\u4f7f\u3063\u3066\u304f\u3060\u3055\u3044\u3002\uff08\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u898b\u308b\u3060\u3051\u3067\u3082\u52c9\u5f37\u306b\u306a\u308a\u307e\u3059\u3088\ud83d\ude0a\uff09<\/span><\/p>\n<p>\u306a\u304a\u3001\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u306f\u901a\u5e38\u306e\u5834\u6240\u3068\u540c\u3058\u3067\u3059\u3002<\/p>\n<h1>\u4f01\u696d\u69d8\u3078\u306e\u3054\u63d0\u6848<\/h1>\n<p>\u3053\u306e\u3088\u3046\u306b\u3001<code>Laravel<\/code>\u306b\u306f\u571f\u53f0\u3068\u306a\u308b\u30d1\u30c3\u30b1\u30fc\u30b8\u304c\u8c4a\u5bcc\u306b\u63d0\u4f9b\u3055\u308c\u3066\u3044\u308b\u305f\u3081\u3001\u30b9\u30d4\u30fc\u30c9\u306e\u65e9\u3044\u958b\u767a\u3092\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u8fd1\u5e74\u3001\u30d3\u30b8\u30cd\u30b9\u3067\u306e\u30b9\u30d4\u30fc\u30c9\u611f\u306f\u7279\u306b\u91cd\u8981\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u306e\u3067\u3001<code>Laravel<\/code>\u306e\u5229\u7528\u306f\u30e1\u30ea\u30c3\u30c8\u304c\u5927\u304d\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n<p>\u307e\u305f\u3001<code>React<\/code>\u3060\u3051\u3067\u306a\u304f<code>Vue<\/code>\u3067\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3082\u53ef\u80fd\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u306e\u3067\u3001\u3053\u308c\u307e\u3067\u306e\u793e\u5185\u306e\u7d4c\u9a13\u3092\u6d3b\u304b\u3057\u305f\u9078\u629e\u3082\u3057\u3084\u3059\u304f\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3082\u3057\u3053\u3046\u3044\u3063\u305f\u3054\u76f8\u8ac7\u304c\u3054\u3056\u3044\u307e\u3057\u305f\u3089\u3001\u304a\u554f\u3044\u5408\u308f\u305b\u304a\u6c17\u8efd\u306b\u3054\u9023\u7d61\u304f\u3060\u3055\u3044\u3002\u304a\u5f85\u3061\u3057\u3066\u304a\u308a\u307e\u3059\u3002m(_ _)m<\/p>\n<h1>\u304a\u308f\u308a\u306b<\/h1>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u4eca\u56de\u306f\u300c<strong>Laravel + Vite + Inertia + React<\/strong>\u300d\u3067\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u3092\u4f5c\u3063\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p><code>Vite<\/code>\u306f\u3068\u3066\u3082\u9ad8\u901f\u306b\u52d5\u304d\u307e\u3059\u3057\u3001<code>Inertia<\/code>\u304c\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u3092\u624b\u4f1d\u3063\u3066\u304f\u308c\u308b\u306e\u3067\u3001\u3053\u306e\u90e8\u5206\u306f\u3068\u3066\u3082\u30e9\u30af\u306b\u958b\u767a\u3092\u9032\u3081\u3089\u308c\u308b\u306a\u3001\u3068\u3044\u3046\u5370\u8c61\u3067\u3057\u305f\u3002<\/p>\n<p>\u3061\u306a\u307f\u306b\u3001<code>Inertia<\/code>\u306f\u3001<code>Ajax<\/code>\u9001\u4fe1\u306e\u90e8\u5206\u3082\u7528\u610f\u3057\u3066\u304f\u308c\u3066\u3044\u308b\u306e\u3067\u300c<strong>\u305d\u3046\u306a\u308b\u3068axios\u306f\u4f7f\u308f\u306a\u304f\u306a\u3063\u3061\u3083\u3046\u306e\u304b\u306a\uff1f<\/strong>\u300d\u3068\u3001\u3061\u3087\u3063\u3068\u3060\u3051\u5bc2\u3057\u3044\u6c17\u6301\u3061\u306b\u306a\u3063\u305f\u306e\u3082\u4e8b\u5b9f\u3067\u3057\u305f\uff08<code>axios<\/code>\u3063\u3066\u540d\u524d\u304c\u304b\u3063\u3053\u3088\u304f\u3066\u597d\u304d\u306a\u3093\u3067\u3059\u3088\u306d\uff09<\/p>\n<p>\u305c\u3072\u7686\u3055\u3093\u3082\u30c1\u30e3\u30ec\u30f3\u30b8\u3057\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-3405\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_18.png\" alt=\"\" width=\"310\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_18.png 310w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_18-291x300.png 291w\" sizes=\"auto, (max-width: 310px) 100vw, 310px\" \/><br \/>\n\u300c\u30c0\u30e0\u3092\u58c1\u306b\u898b\u7acb\u3066\u305f\u3001<br \/>\n\u9032\u6483\u306e\u5de8\u4eba\u30e2\u30cb\u30e5\u30e1\u30f3\u30c8<br \/>\n\u898b\u306b\u884c\u304d\u305f\u3044\u2757\u300d<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u3053\u308c\u306f\u7686\u3055\u3093\u3082\u611f\u3058\u308b\u3053\u3068\u3060\u3068\u601d\u3046\u306e\u3067\u3059\u304c\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u4e16\u754c\u306f\u66f4\u65b0\u304c\u30db\u30f3\u30c8\u306b\u65e9\u3044\u306e\u3067\u3001\u5e38\u306b\u4e16\u306e\u4e2d\u306e\u6d41\u308c\u3092\u611f\u3058\u3066\u3044\u306a\u3044\u3068\u3059\u3050\u53e4\u3044\u6280\u8853\uff06\u53e4\u3044\u8003\u3048\u65b9\u306b\u306a\u3063\u3066\u3057 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.capilano-fw.com\/?p=10845\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;\u3010Laravel\u3011Vite + Inertia + React \u3067\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":10857,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19,3],"tags":[],"class_list":["post-10845","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-javascript","category-laravel"],"_links":{"self":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/10845","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=10845"}],"version-history":[{"count":7,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/10845\/revisions"}],"predecessor-version":[{"id":11437,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/10845\/revisions\/11437"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/media\/10857"}],"wp:attachment":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10845"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10845"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10845"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}