{"id":11138,"date":"2022-11-07T07:00:28","date_gmt":"2022-11-06T22:00:28","guid":{"rendered":"https:\/\/blog.capilano-fw.com\/?p=11138"},"modified":"2022-10-28T03:45:25","modified_gmt":"2022-10-27T18:45:25","slug":"laravel-react-%e3%81%a7%e3%83%93%e3%83%87%e3%82%aa%e9%80%9a%e8%a9%b1%e6%a9%9f%e8%83%bd%e3%82%92%e3%81%a4%e3%81%8f%e3%82%8b","status":"publish","type":"post","link":"https:\/\/blog.capilano-fw.com\/?p=11138","title":{"rendered":"Laravel + React \u3067\u30d3\u30c7\u30aa\u901a\u8a71\u6a5f\u80fd\u3092\u3064\u304f\u308b"},"content":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u6700\u8fd1\u306f\u300c\u30ea\u30e2\u30fc\u30c8\u30ef\u30fc\u30af\u300d\u3068\u3044\u3046\u540d\u524d\u3082\u3088\u304f\u8033\u306b\u3059\u308b\u3088\u3046\u306b\u306a\u308a\u3001\u4e16\u306e\u4e2d\u306e\u5909\u5316\u3092\u611f\u3058\u305a\u306b\u306f\u3044\u3089\u308c\u306a\u3044\u4eca\u65e5\u3053\u306e\u9803\u3067\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001\u3053\u306e\u30ea\u30e2\u30fc\u30c8\u30ef\u30fc\u30af\u3092\u5b9f\u73fe\u3059\u308b\u305f\u3081\u306b\u5fc5\u8981\u3060\u3063\u305f\u306e\u304c\u3001<\/p>\n<p><strong style=\"font-size: 35px;\">\u30d3\u30c7\u30aa\u901a\u8a71<\/strong><\/p>\n<p>\u3068\u3044\u3063\u3066\u3082\u3044\u3044\u3093\u3058\u3083\u306a\u3044\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<p>\u3055\u3059\u304c\u306b\u3001\u97f3\u58f0\u306e\u307f\u306e\u4f1a\u8a71\u3067\u306f\u3042\u307e\u308a\u77e5\u3089\u306a\u3044\u4eba\u3068\u30b3\u30df\u30e5\u30cb\u30b1\u30fc\u30b7\u30e7\u30f3\u304c\u3057\u306b\u304f\u3044\u3067\u3059\u3057\u3001\u8868\u60c5\u3092\u898b\u3066\u8a71\u3057\u305f\u307b\u3046\u304c\u3088\u308a\u8a71\u304c\u4f1d\u308f\u308a\u3084\u3059\u3044\u3067\u3059\u3088\u306d\u3002<\/p>\n<p>\u305d\u3046\u8003\u3048\u308b\u3068\u3001\u30c6\u30af\u30ce\u30ed\u30b8\u30fc\u306e\u9032\u5316\u306b\u3088\u3063\u3066\u79c1\u9054\u306e\u751f\u6d3b\u304c\u5909\u5316\u3057\u3066\u3044\u308b\u3053\u3068\u3092\u5b9f\u611f\u3067\u304d\u308b\u8eab\u8fd1\u306a\u4f8b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<p>\u305d\u3053\u3067\u2757<br \/>\n\u4eca\u56de\u306f\u3053\u306e\u30d3\u30c7\u30aa\u901a\u8a71\u6a5f\u80fd\u3092\u300c<strong>Laravel + React<\/strong>\u300d\u3067\u5b9f\u88c5\u3057\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\u3002<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9470 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/08\/no_13.png\" alt=\"\" width=\"294\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/08\/no_13.png 294w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/08\/no_13-276x300.png 276w\" sizes=\"auto, (max-width: 294px) 100vw, 294px\" \/>\u300c\u8a18\u4e8b\u306e\u4e2d\u3067<br \/>\n\u597d\u304d\u306a\u30dd\u30c6\u30c8\u30c1\u30c3\u30d7\u30b9<br \/>\n\u3092\u7d39\u4ecb\u3057\u3066\u3044\u307e\u3059\u300d<\/p>\n<p><strong>\u958b\u767a\u74b0\u5883\uff1a<\/strong> Laravel 9.x\u3001React\u3001Vite\u3001Intertia.js\u3001TailwindCSS<\/p>\n<h1>\u524d\u63d0\u3068\u3057\u3066<\/h1>\n<p>\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u3066\u3001\u30e6\u30fc\u30b6\u30fc\u304c\u4ee5\u4e0b\u306e\u3088\u3046\u306b\uff12\u4eba\u4ee5\u4e0a\u767b\u9332\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u304c\u524d\u63d0\u3067\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11159\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/10\/laravel_react_video_call_11.png\" alt=\"\" width=\"486\" height=\"474\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/10\/laravel_react_video_call_11.png 486w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/10\/laravel_react_video_call_11-300x293.png 300w\" sizes=\"auto, (max-width: 486px) 100vw, 486px\" \/><\/p>\n<p>\u3082\u3057\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u3044\u306a\u3044\u65b9\u306f\u3001\u4ee5\u4e0b\u3092\u53c2\u8003\u306b\u3057\u3066\u6e96\u5099\u3057\u3066\u304a\u3044\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\ud83d\udcdd<a href=\"https:\/\/blog.capilano-fw.com\/?p=10845\" target=\"_blank\" rel=\"noopener\">\u3010Laravel\u3011Vite + Inertia + React \u3067\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b<\/a><\/p>\n<p>\u307e\u305f\u3001\u4eca\u56de\u306f\u30a6\u30a7\u30d6\u30ab\u30e1\u30e9\u3092\u5229\u7528\u3057\u307e\u3059\u306e\u3067\u3001<code>HTTPS<\/code>\u3067\u306e\u63a5\u7d9a\u304c\u5fc5\u8981\u306b\u306a\u308a\u307e\u3059\u3002<code>HTTPS<\/code>\u3067<code>Vite<\/code>\u3092\u4f7f\u3046\u65b9\u6cd5\u306f\u3001\u300c<a href=\"#vite_https\" target=\"_blank\" rel=\"noopener\">\u3061\u306a\u307f\u306b\uff11\uff1aVite \u3092 HTTPS \u5bfe\u5fdc\u306b\u3059\u308b\u306b\u306f<\/a>\u300d\u3092\u53c2\u8003\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h1>Pusher Channels \u306b\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u3064\u304f\u308b<\/h1>\n<p>\u3067\u306f\u3001\u307e\u305a\u306f\u30b3\u30fc\u30c9\u3092\u66f8\u3044\u3066\u3044\u304f\u524d\u306b<code>Pusher<\/code>\u3067\u5c02\u7528\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u3064\u304f\u308a\u3001\u30a2\u30af\u30bb\u30b9\u30c8\u30fc\u30af\u30f3\u306a\u3069\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002<\/p>\n<p><code>Pusher<\/code>\u3078\u30e6\u30fc\u30b6\u30fc\u767b\u9332\uff06\u30ed\u30b0\u30a4\u30f3\u3057\u3001<code>Channels<\/code>\u306e\u4e2d\u306b\u3042\u308b\u300c<strong>Manage<\/strong>\u300d\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11156\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/10\/laravel_react_video_call_1.png\" alt=\"\" width=\"556\" height=\"233\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/10\/laravel_react_video_call_1.png 556w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/10\/laravel_react_video_call_1-300x126.png 300w\" sizes=\"auto, (max-width: 556px) 100vw, 556px\" \/><\/p>\n<p>\u30da\u30fc\u30b8\u79fb\u52d5\u3059\u308b\u3068\u300c<strong>Create app<\/strong>\u300d\u30dc\u30bf\u30f3\u304c\u3042\u308b\u306e\u3067\u3053\u308c\u3092\u30af\u30ea\u30c3\u30af\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11155\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/10\/laravel_react_video_call_2.png\" alt=\"\" width=\"153\" height=\"87\" \/><\/p>\n<p>\u3059\u308b\u3068\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\uff08Channels app\uff09\u306e\u8a73\u7d30\u5165\u529b\u30d5\u30a9\u30fc\u30e0\u304c\u8868\u793a\u3055\u308c\u308b\u306e\u3067\u3001\u4ee5\u4e0b\u3092\u53c2\u8003\u306b\u3057\u3066\u9069\u5b9c\u5165\u529b\uff06\u300c<strong>Create app<\/strong>\u300d\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<ul>\n<li><strong>Name your app\uff1a<\/strong> \u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u540d<\/li>\n<li><strong>Select a cluster\uff1a<\/strong> ap3\uff08\u6771\u4eac\uff09<\/li>\n<li><strong>Choose your tech stack\uff1a<\/strong>\uff08\u4efb\u610f\u3002\u9078\u629e\u3059\u308b\u3068\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u304c\u8868\u793a\u3055\u308c\u307e\u3059\uff09<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11154\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/10\/laravel_react_video_call_3.png\" alt=\"\" width=\"497\" height=\"586\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/10\/laravel_react_video_call_3.png 497w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/10\/laravel_react_video_call_3-254x300.png 254w\" sizes=\"auto, (max-width: 497px) 100vw, 497px\" \/><\/p>\n<p>\u203b \u306a\u304a\u3001\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11165\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/10\/laravel_react_video_call_4.png\" alt=\"\" width=\"419\" height=\"398\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/10\/laravel_react_video_call_4.png 419w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/10\/laravel_react_video_call_4-300x285.png 300w\" sizes=\"auto, (max-width: 419px) 100vw, 419px\" \/><\/p>\n<p>\u3053\u308c\u3067\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u304c\u4f5c\u6210\u3055\u308c\u305f\u306e\u3067\u3001\u6b21\u306f\u300c<strong>App Settings<\/strong>\u300d\u30e1\u30cb\u30e5\u30fc\u306e\u30ea\u30f3\u30af\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11152\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/10\/laravel_react_video_call_5.png\" alt=\"\" width=\"167\" height=\"399\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/10\/laravel_react_video_call_5.png 167w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/10\/laravel_react_video_call_5-126x300.png 126w\" sizes=\"auto, (max-width: 167px) 100vw, 167px\" \/><\/p>\n<p>\u30da\u30fc\u30b8\u4e2d\u7a0b\u306b\u3042\u308b\u300c<strong>Enable client events<\/strong>\u300d\u306b\u30c1\u30a7\u30c3\u30af\u3092\u5165\u308c\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11151\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/10\/laravel_react_video_call_6.png\" alt=\"\" width=\"540\" height=\"168\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/10\/laravel_react_video_call_6.png 540w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/10\/laravel_react_video_call_6-300x93.png 300w\" sizes=\"auto, (max-width: 540px) 100vw, 540px\" \/><\/p>\n<p>\u3067\u306f\u3001\u6700\u5f8c\u306b<code>API<\/code>\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u305f\u3081\u306e\u30ad\u30fc\uff08\u30c8\u30fc\u30af\u30f3\uff09\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002<br \/>\n\u540c\u3058\u304f\u30e1\u30cb\u30e5\u30fc\u304b\u3089\u300c<strong>App Keys<\/strong>\u300d\u30ea\u30f3\u30af\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11150\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/10\/laravel_react_video_call_7.png\" alt=\"\" width=\"172\" height=\"400\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/10\/laravel_react_video_call_7.png 172w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/10\/laravel_react_video_call_7-129x300.png 129w\" sizes=\"auto, (max-width: 172px) 100vw, 172px\" \/><\/p>\n<p>\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5404\u7a2e\u30ad\u30fc\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11149\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/10\/laravel_react_video_call_8.png\" alt=\"\" width=\"537\" height=\"198\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/10\/laravel_react_video_call_8.png 537w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/10\/laravel_react_video_call_8-300x111.png 300w\" sizes=\"auto, (max-width: 537px) 100vw, 537px\" \/><\/p>\n<p>\u3067\u306f\u3001\u53d6\u5f97\u3057\u305f\u5404\u7a2e\u30ad\u30fc\u3092<code>.env<\/code>\u3078\u8ffd\u52a0\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002\uff08\u304a\u305d\u3089\u304f\u3059\u3067\u306b<code>PUSHER_<\/code>\u3067\u59cb\u307e\u308b\u9805\u76ee\u306f\u5b58\u5728\u3057\u3066\u3044\u307e\u3059\uff09<\/p>\n<p><strong>.env<\/strong><\/p>\n<pre><strong>PUSHER_APP_ID=******<\/strong>\r\n<strong>PUSHER_APP_KEY=******************<\/strong>\r\n<strong>PUSHER_APP_SECRET=******************<\/strong>\r\nPUSHER_HOST=\r\nPUSHER_PORT=443\r\nPUSHER_SCHEME=https\r\n<strong>PUSHER_APP_CLUSTER=***<\/strong><\/pre>\n<p>\u305d\u3057\u3066\u3001\u3064\u3044\u3067\u3067\u3059\u306e\u3067\u30d6\u30ed\u30fc\u30c9\u30ad\u30e3\u30b9\u30c8\u306e\u30c9\u30e9\u30a4\u30d0\u30fc\u304c<code>pusher<\/code>\u306b\u306a\u3063\u3066\u3044\u308b\u304b\u78ba\u8a8d\u3057\u3066\u304a\u3044\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>BROADCAST_DRIVER=pusher<\/strong><\/pre>\n<p>\u307e\u305f\u3001\u5148\u307b\u3069<code>.env<\/code>\u306b\u30bb\u30c3\u30c8\u3057\u305f\u30ad\u30fc\u304c\u30b3\u30f3\u30d5\u30a3\u30b0\u304b\u3089\u53d6\u5f97\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u308b\u304b\u78ba\u8a8d\u3057\u3066\u304a\u3044\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><strong>config\/broadcasting.php<\/strong><\/p>\n<pre>\/\/ \u7701\u7565\r\n\r\n'connections' =&gt; [\r\n\r\n<strong>    'pusher' =&gt; [<\/strong>\r\n<strong>        'driver' =&gt; 'pusher',<\/strong>\r\n<strong>        'key' =&gt; env('PUSHER_APP_KEY'),<\/strong>\r\n<strong>        'secret' =&gt; env('PUSHER_APP_SECRET'),<\/strong>\r\n<strong>        'app_id' =&gt; env('PUSHER_APP_ID'),<\/strong>\r\n<strong>        'options' =&gt; [<\/strong>\r\n<strong>            'host' =&gt; env('PUSHER_HOST', 'api-'.env('PUSHER_APP_CLUSTER', 'mt1').'.pusher.com') ?: 'api-'.env('PUSHER_APP_CLUSTER', 'mt1').'.pusher.com',<\/strong>\r\n<strong>            'port' =&gt; env('PUSHER_PORT', 443),<\/strong>\r\n<strong>            'scheme' =&gt; env('PUSHER_SCHEME', 'https'),<\/strong>\r\n<strong>            'encrypted' =&gt; true,<\/strong>\r\n<strong>            'useTLS' =&gt; env('PUSHER_SCHEME', 'https') === 'https',<\/strong>\r\n<strong>        ],<\/strong>\r\n<strong>        'client_options' =&gt; [<\/strong>\r\n<strong>            \/\/ Guzzle client options: https:\/\/docs.guzzlephp.org\/en\/stable\/request-options.html<\/strong>\r\n<strong>        ],<\/strong>\r\n<strong>        'cluster' =&gt; env('PUSHER_APP_CLUSTER'),<\/strong>\r\n<strong>    ],\r\n\r\n<\/strong>\/\/ \u7701\u7565\r\n<\/pre>\n<p>\u203b \u3082\u3057\u304b\u3059\u308b\u3068\u3001<code>cluster<\/code>\u306f\u629c\u3051\u3066\u308b\u304b\u3082\u3067\u3059\ud83e\udd14<\/p>\n<p>\u3053\u308c\u3067<code>Pusher<\/code>\u5074\u306e\u4f5c\u696d\u306f\u5b8c\u4e86\u3067\u3059\u3002<\/p>\n<h1>\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b<\/h1>\n<p>\u6b21\u306b\u3001\u4eca\u56de\u5fc5\u8981\u306a\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n<p>\u307e\u305a\u306f<code>php<\/code>\u5074\u3067\u3059\u3002<br \/>\n\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"code-helper code-helper-4 hljs coffeescript\"><strong>composer <span class=\"hljs-built_in\">require<\/span> pusher\/pusher-php-server<\/strong><\/pre>\n<p>\u305d\u3057\u3066\u3001\u540c\u3058\u304f<code>JavaScript<\/code>\u5074\u306b\u3082\u4ee5\u4e0b\uff13\u3064\u306e<code>npm<\/code>\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"code-helper code-helper-0 hljs coffeescript\"><strong>npm i --save-dev laravel-echo pusher-js simple-peer\r\n<\/strong><\/pre>\n<p>\u305d\u3057\u3066\u3001<code>Laravel Echo<\/code>\u3068<code>simple-peer<\/code>\u304c<code>Vite<\/code>\u3067\u4f7f\u3048\u308b\u3088\u3046\u306b\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><strong>resources\/js\/bootstrap.js<\/strong><\/p>\n<pre>\/\/ \u521d\u671f\u72b6\u614b\u3067\u306f\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\u3055\u308c\u3066\u3044\u307e\u3059\r\n\r\n<strong>import Echo from 'laravel-echo';<\/strong>\r\n\r\n<strong>import Pusher from 'pusher-js';<\/strong>\r\n<strong>window.Pusher = Pusher;<\/strong>\r\n\r\n<strong>window.Echo = new Echo({<\/strong>\r\n<strong>    broadcaster: 'pusher',<\/strong>\r\n<strong>    key: import.meta.env.VITE_PUSHER_APP_KEY,<\/strong>\r\n<strong>    wsHost: import.meta.env.VITE_PUSHER_HOST ?? `ws-${import.meta.env.VITE_PUSHER_APP_CLUSTER}.pusher.com`,<\/strong>\r\n<strong>    wsPort: import.meta.env.VITE_PUSHER_PORT ?? 80,<\/strong>\r\n<strong>    wssPort: import.meta.env.VITE_PUSHER_PORT ?? 443,<\/strong>\r\n<strong>    forceTLS: (import.meta.env.VITE_PUSHER_SCHEME ?? 'https') === 'https',<\/strong>\r\n<strong>    enabledTransports: ['ws', 'wss'],<\/strong>\r\n<strong>});\r\n\r\n<\/strong>\/\/ simple-peer \u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f<strong>\r\nimport Peer from 'simple-peer\/simplepeer.min.js'\r\nwindow.Peer = Peer;\r\n<\/strong><\/pre>\n<p>\u203b \u306a\u304a\u3001<code>import Peer from 'simple-peer';<\/code>\u3068\u3059\u308b\u3068<code>Vite<\/code>\u3067\u306f\u30a8\u30e9\u30fc\u304c\u51fa\u308b\u3088\u3046\u3067\u3057\u305f\u306e\u3067\u3001<a href=\"https:\/\/github.com\/feross\/simple-peer\/issues\/883#issuecomment-1272022414\" target=\"_blank\" rel=\"noopener\">\u3053\u3061\u3089<\/a> \u3092\u53c2\u8003\u306b\u5909\u66f4\u3057\u3066\u3044\u307e\u3059\u3002\uff08\u4eca\u5f8c\u4fee\u6b63\u3055\u308c\u308b\u304b\u3082\u3067\u3059\ud83d\udc4d\uff09<\/p>\n<h1>\u30eb\u30fc\u30c8\u3092\u3064\u304f\u308b<\/h1>\n<p>\u7d9a\u3044\u3066\u3001\u30eb\u30fc\u30c8\u3067\u3059\u3002<br \/>\n\u307e\u305a\u306f\u30d6\u30e9\u30a6\u30b6\u304b\u3089\u76f4\u63a5\u30a2\u30af\u30bb\u30b9\u3059\u308b\u305f\u3081\u306e\u3082\u306e\u3092\u4f5c\u308a\u307e\u3059\u3002<\/p>\n<p><strong>routes\/web.php<\/strong><\/p>\n<pre>\/\/ \u7701\u7565\r\n\r\n<strong>use App\\Http\\Controllers\\VideoCallController;<\/strong>\r\n\r\n\/\/ \u7701\u7565\r\n\r\n<strong>Route::prefix('video_call')-&gt;controller(VideoCallController::class)-&gt;group(function(){<\/strong>\r\n\r\n<strong>    Route::get('\/', 'index')-&gt;name('video_call.index');<\/strong>\r\n\r\n<strong>});<\/strong><\/pre>\n<p>\u305d\u3057\u3066\u3001\u3082\u3046\u3072\u3068\u3064<code>Pusher<\/code>\u306e\u8a8d\u8a3c\u306b\u4f7f\u3046\u30eb\u30fc\u30c8\u3092<code>channels.php<\/code>\u306b\u30bb\u30c3\u30c8\u3057\u307e\u3059\u3002<\/p>\n<p><strong>routes\/channels.php<\/strong><\/p>\n<pre>\/\/ \u7701\u7565\r\n\r\n<strong>Broadcast::channel('video-call', function ($user) {<\/strong>\r\n\r\n<strong>    return ['id' =&gt; $user-&gt;id, 'name' =&gt; $user-&gt;name];<\/strong>\r\n\r\n<strong>});<\/strong><\/pre>\n<h1>\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\u3064\u304f\u308b<\/h1>\n<p>\u6b21\u306b\u3001\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3067\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>pa make:controller VideoCallController<\/strong><\/pre>\n<p>\u3059\u308b\u3068\u3001\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u308b\u306e\u3067\u4e2d\u8eab\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<p><strong>app\/Http\/Controllers\/VideoCallController.php<\/strong><\/p>\n<pre><strong>&lt;?php<\/strong>\r\n\r\n<strong>namespace App\\Http\\Controllers;<\/strong>\r\n\r\n<strong>use App\\Models\\User;<\/strong>\r\n<strong>use Illuminate\\Http\\Request;<\/strong>\r\n<strong>use Inertia\\Inertia;<\/strong>\r\n\r\n<strong>class VideoCallController extends Controller<\/strong>\r\n<strong>{<\/strong>\r\n<strong>    public function __construct()<\/strong>\r\n<strong>    {<\/strong>\r\n<strong>        $this-&gt;middleware('auth'); \/\/ \u8981\u30ed\u30b0\u30a4\u30f3\u306b\u3059\u308b<\/strong>\r\n<strong>    }<\/strong>\r\n\r\n<strong>    public function index(Request $request)<\/strong>\r\n<strong>    {<\/strong>\r\n<strong>        $user = $request-&gt;user();<\/strong>\r\n<strong>        $other_users = User::select('id', 'name')<\/strong>\r\n<strong>            -&gt;where('id', '!=', $user-&gt;id)<\/strong>\r\n<strong>            -&gt;get(); \/\/ \u81ea\u5206\u4ee5\u5916\u306e\u30e6\u30fc\u30b6\u30fc\u3092\u53d6\u5f97<\/strong>\r\n\r\n<strong>        return Inertia::render('VideoCall\/Index', [<\/strong>\r\n<strong>            'user' =&gt; $user-&gt;only('id', 'name'),<\/strong>\r\n<strong>            'otherUsers' =&gt; $other_users,<\/strong>\r\n<strong>        ]);<\/strong>\r\n<strong>    }<\/strong>\r\n<strong>}<\/strong><\/pre>\n<h1>\u30d3\u30e5\u30fc\u3092\u3064\u304f\u308b<\/h1>\n<p>\u3067\u306f\u3001\u3053\u3053\u304c\u30e1\u30a4\u30f3\u3067\uff08\u3061\u3087\u3063\u3068\u30cf\u30de\u3063\u305f\uff09\u90e8\u5206\u3067\u3059\u3002<\/p>\n<p><strong>resources\/js\/Pages\/VideoCall\/Index.jsx<\/strong><\/p>\n<pre><strong>import {useEffect, useRef} from \"react\";<\/strong>\r\n\r\n<strong>export default function Index(props) {<\/strong>\r\n\r\n<strong>    \/\/ User<\/strong>\r\n<strong>    const user = props.user;<\/strong>\r\n<strong>    const otherUsers = props.otherUsers;<\/strong>\r\n\r\n<strong>    \/\/ Pusher<\/strong>\r\n<strong>    const pusherKey = import.meta.env.VITE_PUSHER_APP_KEY;<\/strong>\r\n<strong>    const pusherCluster = import.meta.env.VITE_PUSHER_APP_CLUSTER;<\/strong>\r\n\r\n<strong>    \/\/ Video<\/strong>\r\n<strong>    const myVideoRef = useRef(null);<\/strong>\r\n<strong>    const otherVideoRef = useRef(null);<\/strong>\r\n<strong>    const videoStreamRef = useRef(null);<\/strong>\r\n<strong>    const videoChannelRef = useRef(null);<\/strong>\r\n<strong>    const peers = useRef({});<\/strong>\r\n<strong>    const getEventName = userId =&gt; `client-signal-${userId}`;<\/strong>\r\n<strong>    const getPeer = (targetUserId, initiator) =&gt; {<\/strong>\r\n\r\n<strong>        if(peers.current[targetUserId] === undefined) {<\/strong>\r\n\r\n<strong>            const peer = new Peer({<\/strong>\r\n<strong>                initiator,<\/strong>\r\n<strong>                stream: videoStreamRef.current,<\/strong>\r\n<strong>                trickle: false,<\/strong>\r\n<strong>            });<\/strong>\r\n\r\n<strong>            peer<\/strong>\r\n<strong>                .on('signal', data =&gt; {<\/strong>\r\n\r\n<strong>                    const eventName = getEventName(targetUserId);<\/strong>\r\n<strong>                    videoChannelRef.current.trigger(eventName, {<\/strong>\r\n<strong>                        userId: user.id,<\/strong>\r\n<strong>                        data: data,<\/strong>\r\n<strong>                    });<\/strong>\r\n\r\n<strong>                })<\/strong>\r\n<strong>                .on('stream', stream =&gt; otherVideoRef.current.srcObject = stream)<\/strong>\r\n<strong>                .on('close', () =&gt; deletePeer(targetUserId));<\/strong>\r\n\r\n<strong>            \/\/ \u901a\u8a71\u3059\u308b\u30e6\u30fc\u30b6\u30fc\u3092\u8ffd\u52a0<\/strong>\r\n<strong>            peers.current = {<\/strong>\r\n<strong>                ...peers.current,<\/strong>\r\n<strong>                ...{ [targetUserId]: peer }<\/strong>\r\n<strong>            };<\/strong>\r\n\r\n<strong>        }<\/strong>\r\n\r\n<strong>        return peers.current[targetUserId];<\/strong>\r\n\r\n<strong>    };<\/strong>\r\n<strong>    const deletePeer = userId =&gt; {<\/strong>\r\n\r\n<strong>        const peer = peers.current[userId];<\/strong>\r\n\r\n<strong>        if(peer !== undefined) {<\/strong>\r\n\r\n<strong>            peer.destroy();<\/strong>\r\n\r\n<strong>        }<\/strong>\r\n\r\n<strong>        const { [userId]: _, ...newPeers } = peers.current; \/\/ \u8a72\u5f53\u3059\u308b\u30e6\u30fc\u30b6\u30fc\u3092\u524a\u9664<\/strong>\r\n<strong>        peers.current = newPeers;<\/strong>\r\n\r\n<strong>    };<\/strong>\r\n<strong>    useEffect(() =&gt; {<\/strong>\r\n\r\n<strong>        navigator.mediaDevices.getUserMedia({ video: true, audio: true })<\/strong>\r\n<strong>            .then(stream =&gt; {<\/strong>\r\n\r\n<strong>                myVideoRef.current.srcObject = stream;<\/strong>\r\n<strong>                videoStreamRef.current = stream;<\/strong>\r\n\r\n<strong>                const pusher = new Pusher(pusherKey, {<\/strong>\r\n<strong>                    authEndpoint: '\/broadcasting\/auth',<\/strong>\r\n<strong>                    cluster: pusherCluster,<\/strong>\r\n<strong>                });<\/strong>\r\n<strong>                const channel = pusher.subscribe('private-video-call');<\/strong>\r\n<strong>                const eventName = getEventName(user.id);<\/strong>\r\n<strong>                channel.bind(eventName, signal =&gt; {<\/strong>\r\n\r\n<strong>                    const userId = signal.userId;<\/strong>\r\n<strong>                    const peer = getPeer(userId, false);<\/strong>\r\n<strong>                    peer.signal(signal.data);<\/strong>\r\n\r\n<strong>                });<\/strong>\r\n<strong>                videoChannelRef.current = channel;<\/strong>\r\n\r\n<strong>            });<\/strong>\r\n\r\n<strong>    }, []);<\/strong>\r\n\r\n<strong>    return (<\/strong>\r\n<strong>        &lt;div className=\"p-5 bg-gray-100\"&gt;<\/strong>\r\n<strong>            &lt;div className=\"p-4 rounded-lg bg-white mb-3\"&gt;<\/strong>\r\n<strong>                {otherUsers &amp;&amp; otherUsers.map(otherUser =&gt; (<\/strong>\r\n<strong>                    &lt;div key={otherUser.id}&gt;<\/strong>\r\n<strong>                        &lt;a<\/strong>\r\n<strong>                            href=\"#\"<\/strong>\r\n<strong>                            className=\"text-blue-500\"<\/strong>\r\n<strong>                            onClick={() =&gt; getPeer(otherUser.id, true)}&gt;<\/strong>\r\n<strong>                            {otherUser.name} \u3055\u3093\u3068\u901a\u8a71\u3059\u308b<\/strong>\r\n<strong>                        &lt;\/a&gt;<\/strong>\r\n<strong>                    &lt;\/div&gt;<\/strong>\r\n<strong>                ))}<\/strong>\r\n<strong>            &lt;\/div&gt;<\/strong>\r\n<strong>            &lt;div className=\"flex\"&gt;<\/strong>\r\n<strong>                &lt;div className=\"flex-1 p-3 border bg-white\"&gt;<\/strong>\r\n<strong>                    &lt;div className=\"text-center\"&gt;\u81ea\u5206\u306e\u6620\u50cf&lt;\/div&gt;<\/strong>\r\n<strong>                    &lt;video ref={myVideoRef} autoPlay&gt;&lt;\/video&gt;<\/strong>\r\n<strong>                &lt;\/div&gt;<\/strong>\r\n<strong>                &lt;div className=\"px-5 pt-3\"&gt;<\/strong>\r\n<strong>                    &lt;div className=\"text-center font-bold\"&gt;\u2194&lt;\/div&gt;<\/strong>\r\n<strong>                &lt;\/div&gt;<\/strong>\r\n<strong>                &lt;div className=\"flex-1 p-3 border bg-white\"&gt;<\/strong>\r\n<strong>                    &lt;div className=\"text-center\"&gt;\u76f8\u624b\u306e\u6620\u50cf&lt;\/div&gt;<\/strong>\r\n<strong>                    &lt;video ref={otherVideoRef} autoPlay&gt;&lt;\/video&gt;<\/strong>\r\n<strong>                &lt;\/div&gt;<\/strong>\r\n<strong>            &lt;\/div&gt;<\/strong>\r\n<strong>        &lt;\/div&gt;<\/strong>\r\n<strong>    );<\/strong>\r\n\r\n<strong>}<\/strong><\/pre>\n<p>\u57fa\u672c\u7684\u306b\u306f\uff12\u3064<code>video<\/code>\u30bf\u30b0\u3092\u7528\u610f\u3057\u3066\u3001\u305d\u3053\u3078\u305d\u308c\u305e\u308c\u306e\u30b9\u30c8\u30ea\u30fc\u30e0\u3092\u30bb\u30c3\u30c8\u3059\u308b\u5f62\u306a\u306e\u3067\u3059\u304c\u3001\u5f53\u521d\u306f\u305d\u308c\u305e\u308c\u5024\u3092<code>useState<\/code>\u3067\u4fdd\u6301\u3057\u3066\u3044\u305f\u305f\u3081\u3046\u307e\u304f\u3044\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002<\/p>\n<p>\u3068\u3044\u3046\u306e\u3082\u3001<code>useState<\/code>\u306e\u66f8\u304d\u63db\u3048\u306f\u975e\u540c\u671f\u306a\u51e6\u7406\uff08\u2252\u5225\u4e16\u754c\u306e\u51fa\u6765\u4e8b\uff09\u306e\u305f\u3081\u3001\u307b\u3057\u3044\u30bf\u30a4\u30df\u30f3\u30b0\u3067\u30c7\u30fc\u30bf\u53d6\u5f97\u3067\u304d\u306a\u3044\u304b\u3089\u3067\u3059\u3002<\/p>\n<p>\u305d\u306e\u305f\u3081\u3001\u4eca\u56de\u306e\u30b1\u30fc\u30b9\u3067\u306f<code>useRef<\/code>\u3092\u3075\u3093\u3060\u3093\u306b\u4f7f\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><code>useRef<\/code>\u306f<code>xxxxxxRef.current<\/code>\u3067\u6700\u65b0\u72b6\u614b\u306e\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3093\u3067\u3059\u306d\u3002\uff08\u305f\u3060\u3057\u3001<code>useRef<\/code>\u306f\u518d\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u3055\u308c\u306a\u3044\u306e\u3067\u898b\u305f\u76ee\u306e\u5909\u66f4\u7528\u306b\u306f\u4f7f\u3048\u307e\u305b\u3093\uff09<\/p>\n<p>\u4ee5\u4e0a\u3067\u4f5c\u696d\u306f\u5b8c\u4e86\u3067\u3059\u3002<br \/>\n\u304a\u3064\u304b\u308c\u3055\u307e\u3067\u3057\u305f\u2757<\/p>\n<h1 id=\"vite_https\">\u3061\u306a\u307f\u306b\uff11\uff1a Vite \u3092 HTTPS \u5bfe\u5fdc\u306b\u3059\u308b\u306b\u306f<\/h1>\n<p><code>Vite<\/code>\u306f\u521d\u671f\u72b6\u614b\u3067\u306f\u8a3c\u660e\u66f8\u304c\u5165\u3063\u3066\u3044\u306a\u3044\u305f\u3081\u3001\u30d6\u30e9\u30a6\u30b6\u3067\u306f<code>https<\/code>\u3068\u3057\u3066\u30a2\u30af\u30bb\u30b9\u304c\u3067\u304d\u307e\u305b\u3093\u3002<\/p>\n<p>\u305d\u306e\u305f\u3081\u3001\u5fc5\u8981\u306a\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n\u3067\u306f\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>npm i --save-dev vite-plugin-mkcert<\/strong><\/pre>\n<p>\u305d\u3057\u3066\u3001\u30b3\u30f3\u30d5\u30a3\u30b0\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5909\u66f4\u3057\u307e\u3059\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 react from '@vitejs\/plugin-react';\r\n<strong>import mkcert from'vite-plugin-mkcert' \/\/ \ud83d\udc48 \u3053\u3053\u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f<\/strong>\r\n\r\nexport default defineConfig({\r\n    plugins: [\r\n        laravel({\r\n            input: 'resources\/js\/app.jsx',\r\n            ssr: 'resources\/js\/ssr.jsx',\r\n            refresh: true,\r\n        }),\r\n        react(),\r\n        <strong>mkcert(), \/\/ \ud83d\udc48 \u3053\u3053\u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f<\/strong>\r\n    ],\r\n    ssr: {\r\n        noExternal: ['@inertiajs\/server'],\r\n    },\r\n    <strong>server: {<\/strong>\r\n<strong>        https: true, \/\/ \ud83d\udc48 \u3053\u3053\u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f<\/strong>\r\n<strong>    }<\/strong>\r\n});<\/pre>\n<p>\u3053\u308c\u3067<code>Vite<\/code>\u3092\u8d77\u52d5\u3057\u3001\u300c<strong>https:\/\/127.0.0.1:5173\/@vite\/client<\/strong>\u300d\u3078\u30a2\u30af\u30bb\u30b9\u3057\u307e\u3059\u3002\uff08\u74b0\u5883\u306b\u3088\u3063\u3066<code>127.0.0.1:5173<\/code>\u306f\u5909\u66f4\u3057\u3066\u304f\u3060\u3055\u3044\uff09<\/p>\n<p>\u3059\u308b\u3068\u3001\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-11142\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/10\/laravel_react_video_call_9.png\" alt=\"\" width=\"636\" height=\"454\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/10\/laravel_react_video_call_9.png 636w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/10\/laravel_react_video_call_9-300x214.png 300w\" sizes=\"auto, (max-width: 636px) 100vw, 636px\" \/><\/p>\n<p>\u305d\u3057\u3066\u3001\u300c<strong>\u8a73\u7d30\u8a2d\u5b9a<\/strong>\u300d\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30b3\u30f3\u30c6\u30f3\u30c4\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u306e\u3067\u3001\u300c<strong>127.0.0.1 \u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\uff08\u5b89\u5168\u3067\u306f\u3042\u308a\u307e\u305b\u3093\uff09<\/strong>\u300d\u30ea\u30f3\u30af\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002<\/p>\n<p>\u203b \u78ba\u304b\u306b\u30b5\u30fc\u30d0\u30fc\u4e0a\u3067\u3084\u308b\u3068\u5371\u967a\u306a\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u304c\u3001\u3053\u3053\u306f\u30ed\u30fc\u30ab\u30eb\u306e\u74b0\u5883\u3067\u3059\u306e\u3067\u554f\u984c\u304c\u3042\u308b\u3053\u3068\u306f\u5c11\u306a\u3044\u3067\u3057\u3087\u3046\u3002\uff08\u3068\u306f\u3044\u3048\u81ea\u5df1\u8cac\u4efb\u3067\u304a\u9858\u3044\u3057\u307e\u3059\u306d\ud83d\ude04\uff09<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11143\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/10\/laravel_react_video_call_10.png\" alt=\"\" width=\"639\" height=\"168\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/10\/laravel_react_video_call_10.png 639w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/10\/laravel_react_video_call_10-300x79.png 300w\" sizes=\"auto, (max-width: 639px) 100vw, 639px\" \/><\/p>\n<p>\u3059\u308b\u3068\u3001<code>Vite<\/code>\u306e\u30b5\u30fc\u30d0\u30fc\u30da\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u306e\u3067\u3001\u3053\u308c\u3067<code>https<\/code>\u304c\u6709\u52b9\u306b\u306a\u308a\u307e\u3059\ud83d\udc4d<\/p>\n<h1>\u3061\u306a\u307f\u306b\uff12\uff1a\u30d3\u30eb\u30c9\u3059\u308b\u6642\u300cSome chunks are larger&#8230;\u300d\u3068\u3044\u3046\u8b66\u544a\u304c\u51fa\u305f\u3089<\/h1>\n<p>\u79c1\u306e\u74b0\u5883\u3067\u306f\u3001<code>Vite<\/code>\u3067\u30d3\u30eb\u30c9\u3059\u308b\u3068\u304d\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u8b66\u544a\u304c\u3067\u307e\u3057\u305f\u3002<\/p>\n<pre><strong>(!) Some chunks are larger than 500 KiB after minification.<\/strong><\/pre>\n<p>\u30d3\u30eb\u30c9\u81ea\u4f53\u306f\u3061\u3083\u3093\u3068\u3067\u304d\u308b\u306e\u3067\u554f\u984c\u306a\u3044\u306e\u3067\u3059\u304c\u3001\u306a\u3093\u304b\u6c17\u6301\u3061\u60aa\u3044\u306e\u3067\u8a2d\u5b9a\u3092\u5909\u66f4\u3057\u307e\u3057\u305f\u3002<\/p>\n<p><strong>vite.config.js<\/strong><\/p>\n<pre>\/\/ \u7701\u7565\r\n\r\n<strong>export default defineConfig({<\/strong>\r\n\r\n    \/\/ \u7701\u7565\r\n\r\n<strong>    build: { \/\/ \ud83d\udc48 \u3053\u306e\u30d6\u30ed\u30c3\u30af\u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f<\/strong>\r\n<strong>        chunkSizeWarningLimit: 1000<\/strong>\r\n<strong>    }<\/strong>\r\n<strong>});<\/strong><\/pre>\n<p>\u3069\u3046\u3084\u3089\u5404\u30d5\u30a1\u30a4\u30eb\u306e\u30b5\u30a4\u30ba\u304c\u3053\u306e\u5024\uff08\u30c7\u30d5\u30a9\u30eb\u30c8: <code>500 kb<\/code>\uff09\u3092\u8d85\u3048\u308b\u3068\u8b66\u544a\u304c\u3067\u308b\u3088\u3046\u3067\u3059\u3002<\/p>\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<code>Vite<\/code>\u306f<code>dev<\/code>\u30d0\u30fc\u30b8\u30e7\u30f3\u3067\u306f\u5916\u90e8\u304b\u3089\u306e\u30a2\u30af\u30bb\u30b9\u306b\u5bfe\u5fdc\u3067\u304d\u307e\u305b\u3093\u306e\u3067\u3001<code>npm run build<\/code>\u3067\u30d3\u30eb\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001\u3053\u306e\u72b6\u614b\u306e\u307e\u307e\uff08\u958b\u767a\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u305b\u305a\uff09\uff12\u3064\u306e\u74b0\u5883\u304b\u3089\u300c<strong>https:\/\/******\/video_call<\/strong>\u300d\u3078\u30a2\u30af\u30bb\u30b9\u3057\u307e\u3059\u3002<\/p>\n<p>\u203b \u3061\u306a\u307f\u306b\u3001\u79c1\u306e\u74b0\u5883\u3067\u306f\uff11\u3064\u306f\u30e1\u30a4\u30f3PC\u3067\u5b9f\u884c\u3057\u3001\u3082\u3046\u4e00\u65b9\u306f\u30ed\u30fc\u30ab\u30eb\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3067\u30b9\u30de\u30db\u304b\u3089\u30a2\u30af\u30bb\u30b9\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u3059\u308b\u3068\u3001\u30ed\u30b0\u30a4\u30f3\u30d5\u30a9\u30fc\u30e0\u304c\u8868\u793a\u3055\u308c\u308b\u306e\u3067\u3001\u305d\u308c\u305e\u308c<strong>\u5225\u306e\u30e6\u30fc\u30b6\u30fc\u3067<\/strong>\u30ed\u30b0\u30a4\u30f3\u3057\u307e\u3059\u3002\uff08\u4eca\u56de\u306e\u30b1\u30fc\u30b9\u3067\u306f\u3001\u300c\u592a\u90ce\u300d\u3055\u3093\u3068\u300c\u6b21\u90ce\u300d\u3055\u3093\u3067\u30ed\u30b0\u30a4\u30f3\u3057\u307e\u3059\uff09<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11160\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/10\/laravel_react_video_call_12.png\" alt=\"\" width=\"488\" height=\"398\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/10\/laravel_react_video_call_12.png 488w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/10\/laravel_react_video_call_12-300x245.png 300w\" sizes=\"auto, (max-width: 488px) 100vw, 488px\" \/><\/p>\n<p>\u30ed\u30b0\u30a4\u30f3\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u300c<strong>\uff08\u81ea\u5206\u4ee5\u5916\u306e\uff09\u30e6\u30fc\u30b6\u30fc\u30ea\u30b9\u30c8<\/strong>\u300d\u300c<strong>\u81ea\u5206\u7528\u306e\u30ab\u30e1\u30e9<\/strong>\u300d\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11161\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/10\/laravel_react_video_call_13.png\" alt=\"\" width=\"640\" height=\"369\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/10\/laravel_react_video_call_13.png 640w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/10\/laravel_react_video_call_13-300x173.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>\u3067\u306f\u3001\u300c<strong>\u592a\u90ce<\/strong>\u300d\u3055\u3093\u3067\u30ed\u30b0\u30a4\u30f3\u3057\u305f\u65b9\uff08\u30e1\u30a4\u30f3PC\uff09\u304b\u3089\u300c<strong>\u6b21\u90ce<\/strong>\u300d\u3055\u3093\u306e\u30ea\u30f3\u30af\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u901a\u8a71\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p>\u203b \u306a\u304a\u3001\u4eca\u56de\u306f\u79c1\u306e\u5927\u597d\u7269\u306e\u6d77\u5916\u88fd\u30dd\u30c6\u30c8\u30c1\u30c3\u30d7\u30b9<code>Lay's<\/code>\u3092\u53cc\u65b9\u5411\u304b\u3089\u64ae\u5f71\u3057\u3066\u307f\u307e\u3059\u3002\uff08\u30db\u30f3\u30c8\u306f<code>original<\/code>\u304c\u4e00\u756a\u597d\u304d\u3067\u3059\u304c\u98df\u3079\u3061\u3083\u3063\u305f\u306e\u3067<code>sour cream &amp; onion<\/code>\u3067\u3059\uff09<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11162\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/10\/laravel_react_video_call_14.png\" alt=\"\" width=\"230\" height=\"253\" \/><\/p>\n<p>\u3069\u3046\u306a\u3063\u305f\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-11163\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/10\/laravel_react_video_call_15.png\" alt=\"\" width=\"640\" height=\"360\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/10\/laravel_react_video_call_15.png 640w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/10\/laravel_react_video_call_15-300x169.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>\u306f\u3044\u2757<br \/>\n\uff08\u3061\u3087\u3063\u3068\u308f\u304b\u308a\u306b\u304f\u3044\u304b\u3082\u3067\u3059\u304c\u2026\uff09\u3046\u307e\u304f\u53cc\u65b9\u5411\u304b\u3089\u306e\u6620\u50cf\u304c\u8868\u793a\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n<p>\u307e\u305f\u3001\u30ad\u30a3\u30fc\u30fc\u30fc\u30fc\u30f3\uff01\uff01\uff01\u3068\u30cf\u30a6\u30ea\u30f3\u30b0\u3057\u3066\u3044\u305f\u306e\u3067\u304a\u305d\u3089\u304f\u97f3\u58f0\u306e\u65b9\u3082\u3046\u307e\u304f\u3044\u3063\u3066\u3044\u308b\u3068\u601d\u3044\u307e\u3059\u3002\uff08\u304a\u6c17\u3092\u3064\u3051\u304f\u3060\u3055\u3044\u3002m(_ _)m\uff09<\/p>\n<p>\u6210\u529f\u3067\u3059\ud83d\ude04\u2728<\/p>\n<h1>\u4f01\u696d\u69d8\u3078\u306e\u3054\u63d0\u6848<\/h1>\n<p>\u4eca\u56de\u306e\u6280\u8853\u3092\u4f7f\u3046\u3068\u3001\u72ec\u81ea\u306e\u30d3\u30c7\u30aa\u901a\u8a71\u6a5f\u80fd\u3092\u3064\u304f\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u306e\u3067\u3001\u4f8b\u3048\u3070\u793e\u5185\u30c4\u30fc\u30eb\u3078\u7d44\u307f\u8fbc\u3093\u3060\u308a\u3001\u30bf\u30d6\u30ec\u30c3\u30c8\u306a\u3069\u3092\u8a2d\u7f6e\u3057\u3066\u304a\u3044\u3066\u30a4\u30f3\u30bf\u30fc\u30db\u30f3\u306e\u3088\u3046\u306b\u4f7f\u3046\u3053\u3068\u3082\u3067\u304d\u308b\u3067\u3057\u3087\u3046\u3002<\/p>\n<p>\u307e\u305f\u3001\u4eca\u56de\u5229\u7528\u3057\u305f<code>Pusher<\/code>\u306f\u6708\u9593200,000\u56de\u307e\u3067\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\u306f\u7121\u6599\uff082022.10.28\u73fe\u5728\uff09\u3067\u4f7f\u3048\u307e\u3059\u306e\u3067\u305d\u308c\u307b\u3069\u5229\u7528\u56de\u6570\u304c\u591a\u304f\u306a\u3044\u5834\u5408\u306f\u7d4c\u8cbb\u3092\u6291\u3048\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002\u8a73\u3057\u304f\u306f <a href=\"https:\/\/pusher.com\/channels\/pricing\" target=\"_blank\" rel=\"noopener\">\u3053\u3061\u3089<\/a> \u3092\u3054\u53c2\u7167\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u306a\u304a\u3001\u3082\u3057\u3053\u3046\u3044\u3063\u305f\u3054\u76f8\u8ac7\u304c\u3054\u3056\u3044\u307e\u3057\u305f\u3089\u3001\u305c\u3072\u304a\u554f\u3044\u5408\u308f\u305b\u304b\u3089\u3054\u9023\u7d61\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\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 + React<\/strong>\u300d\u3067\u30d3\u30c7\u30aa\u901a\u8a71\u6a5f\u80fd\u3092\u4f5c\u3063\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p>\u5b9f\u306f\u3053\u306e\u30d6\u30ed\u30b0\u3067\u306f\u904e\u53bb\u306b<code>Vue<\/code>\u3067\u540c\u3058\u6a5f\u80fd\u3092\u4f5c\u3063\u3066\u307e\u3057\u305f\u304c\u3001\uff13\u5e74\u524d\uff082019\u5e74\uff09\u3060\u3063\u305f\u306e\u3067\u3001\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3084\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u9055\u3044\u3067\u30b3\u30fc\u30c9\u304c\u5909\u66f4\u306b\u306a\u3063\u3066\u3044\u308b\u90e8\u5206\u304c\u3042\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>\u307e\u305f\u3001\u5f53\u6642\u306f<code>Pusher<\/code>\u306e\u8a8d\u8a3c\u3092\u3059\u308b\u30eb\u30fc\u30c8\u3092\u72ec\u81ea\u306b\u3064\u304f\u3063\u3066\u3044\u307e\u3057\u305f\u304c\u3001\u4eca\u56de\u306f<code>Laravel<\/code>\u516c\u5f0f\u306e\u65b9\u6cd5\u3067\u30bb\u30c3\u30c8\u3067\u304d\u307e\u3057\u305f\u306e\u3067\u3001\u3061\u3087\u3063\u3068\u5b09\u3057\u304b\u3063\u305f\u308a\u3082\u3057\u3066\u3044\u307e\u3059\ud83d\udc4d<\/p>\n<p>\u305c\u3072\u7686\u3055\u3093\u3082\uff08\u3061\u3087\u3063\u3068\u8907\u96d1\u3067\u3059\u304c\u2026\uff09\u697d\u3057\u307f\u306a\u304c\u3089\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-9470 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/08\/no_13.png\" alt=\"\" width=\"294\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/08\/no_13.png 294w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/08\/no_13-276x300.png 276w\" sizes=\"auto, (max-width: 294px) 100vw, 294px\" \/>\u300c\u5bdd\u308b\u524d\u306a\u306e\u306b\u30dd\u30c6\u30c8\u30c1\u30c3\u30d7\u30b9<br \/>\n\u98df\u3079\u3061\u3083\u3063\u305f\uff08\u7b11\uff09\u300d<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u6700\u8fd1\u306f\u300c\u30ea\u30e2\u30fc\u30c8\u30ef\u30fc\u30af\u300d\u3068\u3044\u3046\u540d\u524d\u3082\u3088\u304f\u8033\u306b\u3059\u308b\u3088\u3046\u306b\u306a\u308a\u3001\u4e16\u306e\u4e2d\u306e\u5909\u5316\u3092\u611f\u3058\u305a\u306b\u306f\u3044\u3089\u308c\u306a\u3044\u4eca\u65e5\u3053\u306e\u9803\u3067\u3059\u3002 \u305d\u3057\u3066\u3001\u3053\u306e\u30ea\u30e2\u30fc\u30c8\u30ef\u30fc\u30af\u3092\u5b9f\u73fe\u3059\u308b\u305f &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.capilano-fw.com\/?p=11138\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;Laravel + React \u3067\u30d3\u30c7\u30aa\u901a\u8a71\u6a5f\u80fd\u3092\u3064\u304f\u308b&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":11170,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[247,3,118,249,248],"tags":[],"class_list":["post-11138","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-inertia-js","category-laravel","category-react-js","category-tailwind-css","category-vite"],"_links":{"self":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/11138","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=11138"}],"version-history":[{"count":16,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/11138\/revisions"}],"predecessor-version":[{"id":11171,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/11138\/revisions\/11171"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/media\/11170"}],"wp:attachment":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=11138"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=11138"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=11138"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}