{"id":7827,"date":"2020-09-09T07:00:06","date_gmt":"2020-09-08T22:00:06","guid":{"rendered":"https:\/\/blog.capilano-fw.com\/?p=7827"},"modified":"2020-11-25T17:44:51","modified_gmt":"2020-11-25T08:44:51","slug":"laravel8-x%e4%bb%a5%e9%99%8d%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%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/blog.capilano-fw.com\/?p=7827","title":{"rendered":"Laravel8.x\u4ee5\u964d\u3067\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u65b9\u6cd5"},"content":{"rendered":"<p>\u3055\u305b\u3055\u3066\u3001<code>Laravel<\/code>\u306e\u65b0\u30d0\u30fc\u30b8\u30e7\u30f3<code>8.x<\/code>\u304c\u6b63\u5f0f\u306b\u30ea\u30ea\u30fc\u30b9\u3055\u308c\u307e\u3057\u305f\u306e\u3067\u3001\u3053\u308c\u304b\u3089\u3044\u308d\u3044\u308d\u3068\u8a66\u3057\u3066\u3044\u3053\u3046\u3068\u8003\u3048\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001\u4eca\u56de\u306e\u65b0\u6a5f\u80fd\u3067\u4e00\u756a\u8a66\u3057\u3066\u307f\u305f\u304b\u3063\u305f\u3082\u306e\u3002<\/p>\n<p>\u305d\u308c\u306f\u30fb\u30fb\u30fb\u30fb\u30fb\u30fb<\/p>\n<p><strong style=\"font-size: 35px;\">\u65b0\u3057\u304f\u306a\u3063\u305f\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd<\/strong><\/p>\n<p>\u3067\u3059\u3002<\/p>\n<p><code>Laravel<\/code>\u306e\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u306f\u3001<code>6.x<\/code>\u304b\u3089<code>laravel\/ui<\/code>\u3068\u3044\u3046\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u4f7f\u3063\u3066\u3044\u307e\u3057\u305f\u304c\u3001<code>8.x<\/code>\u304b\u3089\u306f\u3053\u306e\u4ee3\u308f\u308a\u3068\u3057\u3066\u3001<\/p>\n<p><strong style=\"font-size: 35px;\">Laravel Jetstream<\/strong><\/p>\n<p>\u3068\u3044\u3046\u30d1\u30c3\u30b1\u30fc\u30b8\u304c\u516c\u958b\u306b\u306a\u3063\u3066\u3044\u308b\u3093\u3067\u3059\u306d\u3002<\/p>\n<p><code>8.x<\/code>\u306e\u30ea\u30ea\u30fc\u30b9\u524d\u306b\u516c\u958b\u3057\u305f\u8a18\u4e8b\u306b\u3082\u66f8\u304d\u307e\u3057\u305f\u304c\u3001\u3053\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u306f\u4ee5\u4e0b\uff16\u3064\u306e\u6a5f\u80fd\u3092\u63d0\u4f9b\u3057\u3066\u304f\u308c\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u30ed\u30b0\u30a4\u30f3<\/li>\n<li>\u30e6\u30fc\u30b6\u30fc\u767b\u9332<\/li>\n<li>\u30e1\u30fc\u30eb\u8a8d\u8a3c\uff08\u672c\u767b\u9332\u30e1\u30fc\u30eb\uff09<\/li>\n<li>\uff12\u6bb5\u968e\u8a8d\u8a3c<\/li>\n<li>\u30bb\u30c3\u30b7\u30e7\u30f3\u7ba1\u7406<\/li>\n<li>\u30c1\u30fc\u30e0\u7ba1\u7406\u3000\uff08\ud83d\udc48 \u4f7f\u3046 or \u4f7f\u308f\u306a\u3044\u3092\u9078\u3079\u307e\u3059\uff09<\/li>\n<\/ul>\n<p>\u305d\u3053\u3067\u2757<\/p>\n<p>\u4eca\u56de\u306f\u3001\u3053\u306e<code>Laravel Jetstream<\/code>\u3092<code>Laravel<\/code>\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u65b9\u6cd5\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<p>\u305c\u3072\u7686\u3055\u3093\u306e\u304a\u5f79\u306b\u7acb\u3066\u307e\u3057\u305f\u3089\u5b09\u3057\u3044\u3067\u3059\u3002\ud83d\ude0a\u2728<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6071 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/03\/no_8.png\" alt=\"\" width=\"216\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/03\/no_8.png 216w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/03\/no_8-203x300.png 203w\" sizes=\"auto, (max-width: 216px) 100vw, 216px\" \/>\u300cJetstream\u306f\u3001\u300e\u30b8\u30a7\u30c3\u30c8\u6c17\u6d41\u300f<br \/>\n\u3063\u3066\u3044\u3046\u610f\u5473\u3060\u305d\u3046\u3067\u3059\u300d<\/p>\n<p><strong>\u958b\u767a\u74b0\u5883\uff1a<\/strong> Laravel 8.x<\/p>\n<h1>\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b<\/h1>\n<h2>\u30d1\u30c3\u30b1\u30fc\u30b8\u672c\u4f53\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b<\/h2>\n<p>\u3067\u306f\u307e\u305a\u672c\u4f53\u3092<code>composer<\/code>\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\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>composer require laravel\/jetstream<\/strong><\/pre>\n<h2>Jetstream\u3067\u4f7f\u3046JavaScript\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u9078\u3093\u3067\u521d\u671f\u5316\u3059\u308b<\/h2>\n<p>\u305d\u3057\u3066\u3001\u3053\u3053\u304c\u7686\u3055\u3093\u306e\u304a\u597d\u307f\u3067\u5206\u304b\u308c\u308b\u90e8\u5206\u306b\u306a\u308b\u3093\u3067\u3059\u304c\u3001\u4ee5\u4e0b\uff12\u3064\u306e<code>JavaScript<\/code>\u30d1\u30c3\u30b1\u30fc\u30b8\u304b\u3089\u3069\u3061\u3089\u304b\u3092\u9078\u3076\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<ul>\n<li>livewire<\/li>\n<li>inertia<\/li>\n<\/ul>\n<p><a href=\"https:\/\/laravel-livewire.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">livewire<\/a> \u3068\u3044\u3046\u306e\u306f\u3001\u300c<strong>\u8907\u96d1\u306b\u306a\u308a\u3059\u304e\u305fJavaScript\u3001\u3082\u3063\u3068\u30b7\u30f3\u30d7\u30eb\u306b\u3084\u308d\u3046\u3088\uff01<\/strong>\u300d\u3068\u3044\u3046\u30b3\u30f3\u30bb\u30d7\u30c8\u3067\u958b\u767a\u3055\u308c\u305f\u30d1\u30c3\u30b1\u30fc\u30b8\u3067\u3001<code>JavaScript<\/code>\u3068<code>PHP<\/code>\u3092\u30b9\u30e0\u30fc\u30ba\u306b\u3064\u306a\u3052\u3066\u304f\u308c\u307e\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001<a href=\"https:\/\/inertiajs.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">inertia<\/a>\u306f\u3001SPA\uff08\u30b7\u30f3\u30b0\u30eb\u30fb\u30da\u30fc\u30b8\u30fb\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\uff09\u3092\u7ba1\u7406\u3059\u308b\u30d1\u30c3\u30b1\u30fc\u30b8\u3067\u3059\u3002<\/p>\n<p>\u3061\u306a\u307f\u306b\u3001\u4ee5\u524d\u3053\u306e\u30d6\u30ed\u30b0\u3067\u306f\u300c<a href=\"https:\/\/blog.capilano-fw.com\/?p=4466\" target=\"_blank\" rel=\"noopener noreferrer\">Laravel + livewire\u3067\u8a95\u751f\u65e5\u304b\u3089\u5e74\u9f62\u3092\u81ea\u52d5\u8a08\u7b97\u3059\u308b<\/a>\u300d\u3068\u3044\u3046\u8a18\u4e8b\u3092\u516c\u958b\u3057\u307e\u3057\u305f\u306e\u3067\u3001\u4eca\u56de\u306f<code>livewire<\/code>\u3092\u4f7f\u3063\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3053\u3068\u306b\u3057\u307e\u3059\u3002<\/p>\n<p>\u3067\u306f\u3001\u4ee5\u4e0b\u306e<code>Artisan<\/code>\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>php artisan jetstream:install livewire --teams<\/strong><\/pre>\n<p>\u203b <code>inertia<\/code>\u306e\u5834\u5408\u306f\u3001\u300c<strong>php artisan jetstream:install inertia &#8211;teams<\/strong>\u300d\u3067\u3059\u3002<\/p>\n<p><strong>\u26a0\u6ce8\u610f\uff1a<\/strong>\u30c1\u30fc\u30e0\u6a5f\u80fd\u304c\u4e0d\u8981\u306e\u65b9\u306f\u3001<code>--teams<\/code>\u306f\u306a\u304f\u3066OK\u3067\u3059\u3002<\/p>\n<h2>\u30d3\u30eb\u30c9\u3059\u308b<\/h2>\n<p>\u3059\u308b\u3068\u3001\u9078\u3093\u3060\u30d1\u30c3\u30b1\u30fc\u30b8\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u308b\u306e\u3067\u7d9a\u3044\u3066\u3053\u308c\u3089\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30b3\u30f3\u30d1\u30a4\u30eb\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre><strong>npm install &amp;&amp; npm run dev<\/strong><\/pre>\n<h2>\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u5b9f\u884c<\/h2>\n<p>\u5fd8\u308c\u3066\u306f\u3044\u3051\u306a\u3044\u306e\u304c\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u306e\u5b9f\u884c\u3067\u3059\u3002<br \/>\n\u3053\u3061\u3089\u3082\u5fd8\u308c\u305a\u306b\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304a\u3044\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>php artisan migrate<\/strong><\/pre>\n<p>\u3053\u308c\u3067\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30c6\u30fc\u30d6\u30eb\u69cb\u6210\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-7830\" style=\"border: 3px solid;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/09\/laravel_jetstream_1.png\" alt=\"\" width=\"640\" height=\"414\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/09\/laravel_jetstream_1.png 640w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/09\/laravel_jetstream_1-300x194.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>\u3053\u308c\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306f\u5b8c\u4e86\u3067\u3059\u3002<\/p>\n<p>\u30c8\u30c3\u30d7\u30da\u30fc\u30b8\u3092\u958b\u3044\u3066\u307f\u308b\u3068\u30da\u30fc\u30b8\u53f3\u4e0a\u306b\u30ed\u30b0\u30a4\u30f3\u3068\u30e6\u30fc\u30b6\u30fc\u767b\u9332\u306e\u30ea\u30f3\u30af\u304c\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-7838\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/09\/laravel_jetstream_2.png\" alt=\"\" width=\"640\" height=\"204\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/09\/laravel_jetstream_2.png 640w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/09\/laravel_jetstream_2-300x96.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>\u8a66\u3057\u306b\u30ed\u30b0\u30a4\u30f3\u30da\u30fc\u30b8\u3092\u958b\u3044\u3066\u307f\u308b\u3068\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30da\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-7832\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/09\/laravel_jetstream_3.png\" alt=\"\" width=\"483\" height=\"390\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/09\/laravel_jetstream_3.png 483w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/09\/laravel_jetstream_3-300x242.png 300w\" sizes=\"auto, (max-width: 483px) 100vw, 483px\" \/><\/p>\n<h1 id=\"test_data\">\u65b0\u3057\u3044Factory\u3067\u30c6\u30b9\u30c8\u30e6\u30fc\u30b6\u30fc\u3092\u3064\u304f\u3063\u3066\u30ed\u30b0\u30a4\u30f3\u3057\u3066\u307f\u308b<\/h1>\n<p>\u3067\u306f\u3001\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u306e\u3067\u3001\u3044\u304f\u3064\u304b\u30c6\u30b9\u30c8\u30c7\u30fc\u30bf\u3092\u3064\u304f\u3063\u3066\u5b9f\u969b\u306b\u30ed\u30b0\u30a4\u30f3\u3057\u3066\u307f\u307e\u3057\u3087\u3046\uff01<\/p>\n<p>\u3061\u306a\u307f\u306b\u3001\u30c6\u30b9\u30c8\u30c7\u30fc\u30bf\u3068\u3044\u3048\u3070\u3001<code>Seeder<\/code>\u30d5\u30a1\u30a4\u30eb\u3092\u3064\u304f\u3063\u3066\u30fb\u30fb\u30fb\u3068\u8003\u3048\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u304c\u3001\u5b9f\u306f<code>Laravel 8.x<\/code>\u306b\u306f\u65b0\u3057\u304f\u306a\u3063\u305f<code>Factory<\/code>\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u305b\u3063\u304b\u304f\u306a\u306e\u3067\u3053\u3061\u3089\u3092\u4f7f\u3063\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u30fb\u30fb\u30fb\u3068\u3044\u3063\u3066\u3082\u3001\u5b9f\u306f\u30d5\u30a1\u30a4\u30eb\u306f\u7528\u610f\u3057\u3066\u304f\u308c\u3066\u3044\u308b\u306e\u3067\u3001\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\u3057\u3066\u4f7f\u3048\u308b\u3088\u3046\u306b\u3059\u308b\u3060\u3051\u3067OK\u3067\u3059\u3002\uff08\u305f\u3060\u3057\u3001\u30cd\u30fc\u30e0\u30b9\u30da\u30fc\u30b9\u3082\u5fd8\u308c\u306a\u3044\u3067\u304f\u3060\u3055\u3044\uff09<\/p>\n<p><strong>database\/seeders\/DatabaseSeeder.php<\/strong><\/p>\n<pre>&lt;?php\r\n\r\nnamespace Database\\Seeders;\r\n\r\n<strong>use App\\Models\\User;<\/strong> \/\/ \ud83d\udc48 \u30cd\u30fc\u30e0\u30b9\u30da\u30fc\u30b9\u3092\u8ffd\u52a0\r\nuse Illuminate\\Database\\Seeder;\r\n\r\nclass DatabaseSeeder extends Seeder\r\n{\r\n    public function run()\r\n    {\r\n         <strong>User::factory(10)-&gt;create();<\/strong> \/\/ \ud83d\udc48\u3053\u3053\u306e\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\u3092\u5916\u3059\r\n    }\r\n}<\/pre>\n<p>\u3082\u3057\u30e6\u30fc\u30b6\u30fc\u30c6\u30fc\u30d6\u30eb\u306e\u69cb\u6210\u3092\u5909\u66f4\u3057\u3066\u3044\u308b\u5834\u5408\u306f\u3001\u300c<strong>database\/factories\/UserFactory.php<\/strong>\u300d\u306e\u4e2d\u3067\u5909\u66f4\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre><strong>\/\/ \u2139 \u4f8b\u3048\u3070\u5e74\u9f62\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u8ffd\u52a0\u3057\u3066\u3044\u308b\u5834\u5408<\/strong>\r\n\r\npublic function definition()\r\n{\r\n    return [\r\n        'name' =&gt; $this-&gt;faker-&gt;name,\r\n        'email' =&gt; $this-&gt;faker-&gt;unique()-&gt;safeEmail,\r\n        'email_verified_at' =&gt; now(),\r\n        'password' =&gt; '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC\/.og\/at2.uheWG\/igi', \/\/ password\r\n        'remember_token' =&gt; Str::random(10),\r\n        <strong>'age' =&gt; rand(0, 120), \/\/ \ud83d\udc48 \u3053\u3093\u306a\u611f\u3058\u3067\u3059<\/strong>\r\n    ];\r\n}<\/pre>\n<p>\u306a\u304a\u3001\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306e\u3068\u304d\u306b\u300c<strong>\u30c1\u30fc\u30e0\u7ba1\u7406<\/strong>\u300d\u3092\u6709\u52b9\u306b\u3057\u305f\u5834\u5408\u3001\u5404\u30e6\u30fc\u30b6\u30fc\u304c\u6700\u4f4e\u3067\u3082\u3072\u3068\u3064\u306e\u30c1\u30fc\u30e0\u306b\u6240\u5c5e\u3057\u3066\u3044\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u305d\u306e\u5834\u5408\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u3066\u30c1\u30fc\u30e0\u3092\u8ffd\u52a0\u3059\u308b\u3088\u3046\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><strong>\u3010\u8ffd\u8a18\uff1a2020.9.15\u3011<\/strong><code>created<\/code>\u30a4\u30d9\u30f3\u30c8\u3067\u81ea\u52d5\u7684\u306b\u30c1\u30fc\u30e0\u8ffd\u52a0\u3067\u304d\u308b\u3088\u3046\u5909\u66f4\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u307e\u305a\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067\u30a4\u30d9\u30f3\u30c8\u30fb\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<pre><strong>php artisan make:event UserCreated<\/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\u5909\u66f4\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><strong>app\/Events\/UserCreated.php<\/strong><\/p>\n<pre>&lt;?php\r\n\r\nnamespace App\\Events;\r\n\r\n<strong>use App\\Models\\Team;<\/strong>\r\n<strong>use App\\Models\\User;<\/strong>\r\n\r\n\/\/ \u7701\u7565\r\n\r\nclass UserCreated\r\n{\r\n    \/\/ \u7701\u7565\r\n\r\n    public function __construct(<strong>User $user<\/strong>)\r\n    {\r\n        <strong>$team = new Team();<\/strong>\r\n<strong>        $team-&gt;user_id = $user-&gt;id;<\/strong>\r\n<strong>        $team-&gt;name = $user-&gt;name .' \u3055\u3093\u306e\u30c1\u30fc\u30e0';<\/strong>\r\n<strong>        $team-&gt;personal_team = true;<\/strong>\r\n<strong>        $team-&gt;save();<\/strong>\r\n    }<\/pre>\n<p>\u305d\u3057\u3066\u3001\u3053\u306e\u30a4\u30d9\u30f3\u30c8\u3092<code>User<\/code>\u30e2\u30c7\u30eb\u306b\u30bb\u30c3\u30c8\u3057\u307e\u3059\u3002<\/p>\n<p><strong>app\/Models\/User.php<\/strong><\/p>\n<pre>&lt;?php\r\n\r\n<strong>use App\\Events\\UserCreated;<\/strong>\r\n\r\n\/\/ \u7701\u7565\r\n\r\nclass User extends Authenticatable\r\n{\r\n    \/\/ \u7701\u7565\r\n\r\n    <strong>protected $dispatchesEvents = [<\/strong>\r\n<strong>        'created' =&gt; UserCreated::class<\/strong>\r\n<strong>    ];<\/strong><\/pre>\n<p><strong>\u3010\u8ffd\u8a18\uff1a2020.11.25\u3011<\/strong>\u30cd\u30fc\u30e0\u30b9\u30da\u30fc\u30b9\u304c\u629c\u3051\u3066\u3044\u307e\u3057\u305f\u306e\u3067\u8ffd\u52a0\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u3053\u308c\u3067\u30c6\u30b9\u30c8\u30c7\u30fc\u30bf\u306e\u6e96\u5099\u306f\u5b8c\u4e86\u3067\u3059\u3002<\/p>\n<p>\u3067\u306f\u3001\u3053\u306e\u72b6\u614b\u3067<code>Seeder<\/code>\u3092\u5b9f\u884c\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 db:seed<\/strong><\/pre>\n<p>\uff08\u3082\u3057\u304f\u306f\u3053\u3061\u3089\u3067\u3082OK\uff09<\/p>\n<pre><strong>php artisan migrate:fresh --seed<\/strong><\/pre>\n<p>\u3059\u308b\u3068<code>users<\/code>\u30c6\u30fc\u30d6\u30eb\u306f\u3053\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-7833\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/09\/laravel_jetstream_4.png\" alt=\"\" width=\"533\" height=\"488\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/09\/laravel_jetstream_4.png 533w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/09\/laravel_jetstream_4-300x275.png 300w\" sizes=\"auto, (max-width: 533px) 100vw, 533px\" \/><\/p>\n<p>\u26a0<strong>\u3054\u6ce8\u610f\uff1a<\/strong><code>Laravel<\/code>\u672c\u4f53\u306e\u8a00\u8a9e\u3092\u5909\u66f4\u3057\u3066\u3044\u306a\u3044\u5834\u5408\u306f\u82f1\u8a9e\u540d\u306b\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u3002\u305d\u306e\u5834\u5408\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8a2d\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><strong>config\/app.php<\/strong><\/p>\n<pre>&lt;?php\r\n\r\nreturn [\r\n\r\n    \/\/ \u7701\u7565\r\n\r\n    <strong>'timezone' =&gt; 'Asia\/Tokyo'<\/strong>, \/\/ \u30bf\u30a4\u30e0\u30be\u30fc\u30f3\r\n    <strong>'locale' =&gt; 'ja'<\/strong>, \/\/ \u5229\u7528\u3059\u308b\u8a00\u8a9e\r\n    'fallback_locale' =&gt; 'en', \/\/ \u65e5\u672c\u8a9e\u304c\u306a\u3044\u5834\u5408\u306e\u4e88\u5099\u8a00\u8a9e\uff08\u305d\u306e\u307e\u307e\u3067OK\uff09\r\n    <strong>'faker_locale' =&gt; 'ja_JP'<\/strong>, \/\/ \ud83d\udc48 \u3053\u3053\u304cFactory\u306b\u5f71\u97ff\u3057\u307e\u3059\r\n\r\n    \/\/ \u7701\u7565\r\n\r\n];<\/pre>\n<p>\u3067\u306f\u3001\u30c6\u30b9\u30c8\u30e6\u30fc\u30b6\u30fc\u304c\u8ffd\u52a0\u3055\u308c\u305f\u306e\u3067\u30ed\u30b0\u30a4\u30f3\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-7834\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/09\/laravel_jetstream_5.png\" alt=\"\" width=\"487\" height=\"397\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/09\/laravel_jetstream_5.png 487w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/09\/laravel_jetstream_5-300x245.png 300w\" sizes=\"auto, (max-width: 487px) 100vw, 487px\" \/><\/p>\n<p>\u30ed\u30b0\u30a4\u30f3\u3067\u304d\u308b\u3068\u3001\u6b21\u306e\u3088\u3046\u306a\u8868\u793a\u306b\u306a\u308a\u307e\u3059\u3002\uff08\u30ad\u30ec\u30a4\u3067\u3059\u306d\uff01\uff09<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-7835\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/09\/laravel_jetstream_6.png\" alt=\"\" width=\"640\" height=\"413\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/09\/laravel_jetstream_6.png 640w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/09\/laravel_jetstream_6-300x194.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>\u3061\u306a\u307f\u306b\u3001\u53f3\u4e0a\u306e\u30a2\u30a4\u30b3\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u3044\u308d\u3044\u308d\u306a\u30da\u30fc\u30b8\u3078\u306e\u30ea\u30f3\u30af\u304c\u8868\u793a\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-7836\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/09\/laravel_jetstream_7.png\" alt=\"\" width=\"226\" height=\"421\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/09\/laravel_jetstream_7.png 226w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/09\/laravel_jetstream_7-161x300.png 161w\" sizes=\"auto, (max-width: 226px) 100vw, 226px\" \/><\/p>\n<p>\u26a0<strong>\u3054\u6ce8\u610f\uff1a<\/strong> \u30d7\u30ed\u30d5\u30a3\u30fc\u30eb\u30da\u30fc\u30b8\u306b\u753b\u50cf\u3092\u767b\u9332\u3059\u308b\u90e8\u5206\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u3053\u306e\u753b\u50cf\u306f\u300c<strong>storage\/app\/public\/profile-photos<\/strong>\u300d\u306b\u4fdd\u5b58\u3055\u308c\u307e\u3059\u3002\u3064\u307e\u308a\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304a\u304b\u306a\u3044\u3068\u753b\u50cf\u306f\u8868\u793a\u3055\u308c\u307e\u305b\u3093\u3002<\/p>\n<pre><strong>php artisan storage:link<\/strong><\/pre>\n<p>\u304a\u75b2\u308c\u69d8\u3067\u3057\u305f\ud83d\ude0a\u2728<\/p>\n<h1>\u304a\u308f\u308a\u306b<\/h1>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u4eca\u56de\u306f\u65e9\u901f<code>Laravel Jetstream<\/code>\u3067\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p>\u4f7f\u3063\u3066\u307f\u305f\u611f\u60f3\u306f\u3001\u300c<strong>\u3053\u3060\u308f\u308a\u304c\u306a\u3051\u308c\u3070\u3001\u30e6\u30fc\u30b6\u30fc\u30da\u30fc\u30b8\u306f\u3053\u308c\u3060\u3051\u3067\u5341\u5206\uff01<\/strong>\u300d\u3068\u3044\u3046\u3082\u306e\u3067\u3057\u305f\u3002<\/p>\n<p>\u305f\u3060\u3057\u3001\u79c1\u306b\u3068\u3063\u3066\u3042\u307e\u308a\u99b4\u67d3\u307f\u3067\u306f\u306a\u3044\u4ee5\u4e0b\uff12\u3064\u306e\u30c6\u30af\u30ce\u30ed\u30b8\u30fc\u304c\u4f7f\u308f\u308c\u3066\u3044\u307e\u3059\u306e\u3067\u3001\u305d\u3053\u306b\u6163\u308c\u308b\u307e\u3067\u306f\u5c11\u3057\u6642\u9593\u304c\u5fc5\u8981\u304b\u306a\u3068\u3082\u611f\u3058\u307e\u3057\u305f\u3002<\/p>\n<ul>\n<li>livewire\uff08\u3082\u3057\u304f\u306f\u3001inertia\uff09<\/li>\n<li>Tailwind CSS<\/li>\n<\/ul>\n<p>\u306a\u304a\u3001\u300c<strong>API\u30c8\u30fc\u30af\u30f3<\/strong>\u300d\u3084\u3001\u300c<strong>\u30c1\u30fc\u30e0\u7ba1\u7406<\/strong>\u300d\u306e\u6a5f\u80fd\u306f\u307e\u3060\u307e\u3060\u7d39\u4ecb\u3057\u304d\u308c\u3066\u3044\u306a\u3044\u306e\u3067\u3001\u4eca\u5f8c\u306e\u8a18\u4e8b\u3067\u3054\u7d39\u4ecb\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/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\uff01<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4445 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/no_2.png\" alt=\"\" width=\"370\" height=\"310\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/no_2.png 370w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/no_2-300x251.png 300w\" sizes=\"auto, (max-width: 370px) 100vw, 370px\" \/>\u300cIT\u696d\u754c\u306e\u9032\u6b69\u306f\u65e9\u3044\u3067\u3059\u306d\u301c\u2757\u300d<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3055\u305b\u3055\u3066\u3001Laravel\u306e\u65b0\u30d0\u30fc\u30b8\u30e7\u30f38.x\u304c\u6b63\u5f0f\u306b\u30ea\u30ea\u30fc\u30b9\u3055\u308c\u307e\u3057\u305f\u306e\u3067\u3001\u3053\u308c\u304b\u3089\u3044\u308d\u3044\u308d\u3068\u8a66\u3057\u3066\u3044\u3053\u3046\u3068\u8003\u3048\u3066\u3044\u307e\u3059\u3002 \u305d\u3057\u3066\u3001\u4eca\u56de\u306e\u65b0\u6a5f\u80fd\u3067\u4e00\u756a\u8a66\u3057\u3066\u307f\u305f &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.capilano-fw.com\/?p=7827\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;Laravel8.x\u4ee5\u964d\u3067\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u65b9\u6cd5&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":7842,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[58],"class_list":["post-7827","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-laravel","tag-58"],"_links":{"self":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/7827","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=7827"}],"version-history":[{"count":14,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/7827\/revisions"}],"predecessor-version":[{"id":7884,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/7827\/revisions\/7884"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/media\/7842"}],"wp:attachment":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7827"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7827"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7827"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}