{"id":11099,"date":"2022-10-17T07:00:58","date_gmt":"2022-10-16T22:00:58","guid":{"rendered":"https:\/\/blog.capilano-fw.com\/?p=11099"},"modified":"2022-10-12T03:09:07","modified_gmt":"2022-10-11T18:09:07","slug":"laravel-react-%e3%81%a7-%e5%85%b1%e5%90%8c%e7%b7%a8%e9%9b%86%e3%83%9a%e3%83%bc%e3%82%b8%e3%81%ae%e3%83%ad%e3%83%83%e3%82%af%e6%a9%9f%e8%83%bd%e3%82%92%e3%81%a4%e3%81%8f%e3%82%8b%ef%bc%88%e5%bc%95","status":"publish","type":"post","link":"https:\/\/blog.capilano-fw.com\/?p=11099","title":{"rendered":"Laravel + React \u3067 \u5171\u540c\u7de8\u96c6\u30da\u30fc\u30b8\u306e\u30ed\u30c3\u30af\u6a5f\u80fd\u3092\u3064\u304f\u308b\uff08\u5f15\u304d\u7d99\u304e\u6a5f\u80fd\u3082\uff01\uff09"},"content":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u524d\u56de\u8a18\u4e8b\u306f <a href=\"https:\/\/blog.capilano-fw.com\/?p=11085\">Laravel Precognition \u3067\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u30fb\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u3092\u3064\u304f\u308b<\/a> \u3067\u3001<code>Laravel<\/code>\u306e\u65b0\u6a5f\u80fd\u300c<strong>Precognition<\/strong>\u300d\u3092\u4f7f\u3063\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p>\u305d\u3057\u3066\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u30fb\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u306f<code>Precognition<\/code>\u3092\u4f7f\u3046\u6642\u306e\u5206\u304b\u308a\u3084\u3059\u3044\u4f8b\u3060\u3063\u305f\u306e\u3067\u6311\u6226\u3057\u3066\u307f\u305f\u306e\u3067\u3059\u304c\u3001\u5b9f\u306f\u3082\u3046\u4e00\u3064\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306b\u3082\u66f8\u304b\u308c\u3066\u3044\u308b\u300c<strong>\u3042\u308b\u3053\u3068<\/strong>\u300d\u3082\u3084\u3063\u3066\u307f\u305f\u3044\u3068\u601d\u3063\u3066\u3044\u307e\u3057\u305f\u3002<\/p>\n<p>\u305d\u308c\u306f\u30fb\u30fb\u30fb\u30fb\u30fb\u30fb<\/p>\n<p><strong style=\"font-size: 35px;\">\uff08\u5171\u540c\u7de8\u96c6\u3067\u304d\u308b\uff09\u30da\u30fc\u30b8\u306e\u30ed\u30c3\u30af\u6a5f\u80fd<\/strong><\/p>\n<p>\u3067\u3059\u3002<\/p>\n<p>\u3064\u307e\u308a\u3001\u8907\u6570\u306e\u30e6\u30fc\u30b6\u30fc\u304c\u30ed\u30b0\u30a4\u30f3\u3059\u308b\u30b7\u30b9\u30c6\u30e0\u304c\u3042\u3063\u3066\u3001\u540c\u3058\u30da\u30fc\u30b8\u3092\u7de8\u96c6\u3057\u3088\u3046\u3068\u3059\u308b\u3068\u5f8c\u304b\u3089\u6765\u305f\u4eba\u306f\u30da\u30fc\u30b8\u304c\u7de8\u96c6\u3067\u304d\u306a\u304f\u306a\u308b\u3068\u3044\u3046\u6a5f\u80fd\u3067\u3059\u3002<\/p>\n<p>\u3053\u3046\u3059\u308b\u3053\u3068\u3067\u3001\u300c<strong>\u3042\u308c\uff01\uff1f\u79c1\u304c\u66f8\u3044\u305f\u30c6\u30ad\u30b9\u30c8\u304c\u4e38\u3005\u4e0a\u66f8\u304d\u3055\u308c\u3066\u308b\u3093\u3060\u3051\u3069\u2026\ud83d\ude2b<\/strong>\u300d\u3068\u3044\u3046\u3053\u3068\u304c\u306a\u304f\u306a\u308b\u3068\u3044\u3046\u8a33\u3067\u3059\u306d\u3002<\/p>\n<p>\u305d\u3053\u3067\u2757<\/p>\n<p>\u4eca\u56de\u306f\u300c<strong>Laravel + React<\/strong>\u300d\u3067\u3053\u306e\u300c<strong>\u30ed\u30c3\u30af\u6a5f\u80fd<\/strong>\u300d\u3092\u4f5c\u3063\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u306a\u304a\u3001\u30ed\u30c3\u30af\u3055\u308c\u305f\u5074\u306f\u300c<strong>\u5f15\u304d\u7d99\u3050<\/strong>\u300d\u6a5f\u80fd\u3067\u7de8\u96c6\u6a29\u3092\uff08\u8a00\u3044\u65b9\u304c\u60aa\u3044\u3067\u3059\u304c\uff09\u596a\u3046\u3053\u3068\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u3066\u307f\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\ud83d\ude04\u2728<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-2173 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/no_24.png\" alt=\"\" width=\"300\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/no_24.png 300w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2018\/11\/no_24-281x300.png 281w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/>\u300c\u7d0d\u8c46\u8cb7\u3044\u3059\u304e\u3066<br \/>\n\u4e94\u91cd\u5854\u307f\u305f\u3044\u306b<br \/>\n\u7a4d\u307f\u4e0a\u304c\u3063\u3066\u307e\u3059\uff08\u7b11\uff09\u300d<\/p>\n<p><strong>\u958b\u767a\u74b0\u5883\uff1a<\/strong> Laravel 9.x\u3001React\u3001Inertia.js\u3001TailwindCSS\u3001Vite<\/p>\n<h1>\u524d\u63d0\u3068\u3057\u3066<\/h1>\n<p><code>Laravel<\/code>\u306b\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u304c\u524d\u63d0\u3067\u3059\u3002<br \/>\n\u3082\u3057\u307e\u3060\u306e\u65b9\u306f\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\u00a0<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<h1>\u30e2\u30c7\u30eb\uff06\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\uff06Seeder\uff06\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\u3064\u304f\u308b<\/h1>\n<p>\u307e\u305a\u306f\u4e2d\u5fc3\u3068\u306a\u308b\u30d5\u30a1\u30a4\u30eb\u306e\u6e96\u5099\u304b\u3089\u59cb\u3081\u307e\u3059\u3002<br \/>\n\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u203b \u3061\u306a\u307f\u306b\u4eca\u56de\u306f\u300c\u5831\u544a\u66f8\u300d\u306e\u30c7\u30fc\u30bf\u3092\u4f7f\u3063\u3066\u5b9f\u88c5\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<pre><strong>php artisan make:model Report -msc<\/strong><\/pre>\n<p>\u3059\u308b\u3068\u3001\uff14\u30d5\u30a1\u30a4\u30eb\u4f5c\u6210\u3055\u308c\u308b\u306e\u3067\u3001\u305d\u308c\u305e\u308c\u4e2d\u8eab\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n<h2>\u30e2\u30c7\u30eb<\/h2>\n<p><strong>app\/Models\/Report.php<\/strong><\/p>\n<pre>&lt;?php\r\n\r\nnamespace App\\Models;\r\n\r\nuse Illuminate\\Database\\Eloquent\\Factories\\HasFactory;\r\nuse Illuminate\\Database\\Eloquent\\Model;\r\n\r\nclass Report extends Model\r\n{\r\n    use HasFactory;\r\n\r\n    <strong>\/\/ Relationship<\/strong>\r\n<strong>    public function edit_user()<\/strong>\r\n<strong>    {<\/strong>\r\n<strong>        return $this-&gt;belongsTo('App\\Models\\User', 'edit_user_id');<\/strong>\r\n<strong>    }<\/strong>\r\n\r\n<strong>    \/\/ Accessor<\/strong>\r\n<strong>    public function getIsEditingByOthersAttribute()<\/strong>\r\n<strong>    {<\/strong>\r\n<strong>        return (<\/strong>\r\n<strong>            ! is_null($this-&gt;edit_started_at) &amp;&amp;<\/strong>\r\n<strong>            $this-&gt;edit_user_id !== auth()-&gt;id()<\/strong>\r\n<strong>        );<\/strong>\r\n<strong>    }<\/strong>\r\n}<\/pre>\n<p>\u3053\u306e\u4e2d\u3067\u306f\u3001\u30e6\u30fc\u30b6\u30fc\u30c6\u30fc\u30d6\u30eb\u3078\u306e\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u3068\u300c<strong>\u4ed6\u306e\u30e6\u30fc\u30b6\u30fc\u304c\u7de8\u96c6\u4e2d\u304b\u3069\u3046\u304b<\/strong>\u300d\u304c\u308f\u304b\u308b<code>Accessor<\/code>\u3092\u3064\u304f\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3064\u307e\u308a\u3001<code>$report-&gt;is_editing_by_others<\/code>\u3067\u7c21\u5358\u306b\u30c1\u30a7\u30c3\u30af\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h2>\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3<\/h2>\n<p><strong>database\/migrations\/****_**_**_******_create_reports_table.php<\/strong><\/p>\n<pre>\/\/ \u7701\u7565\r\n\r\npublic function up()\r\n{\r\n    <strong>Schema::create('reports', function (Blueprint $table) {<\/strong>\r\n<strong>        $table-&gt;id();<\/strong>\r\n<strong>        $table-&gt;string('title')-&gt;comment('\u30bf\u30a4\u30c8\u30eb');<\/strong>\r\n<strong>        $table-&gt;text('body')-&gt;comment('\u672c\u6587');<\/strong>\r\n<strong>        $table-&gt;dateTime('edit_started_at')-&gt;nullable()-&gt;comment('\u7de8\u96c6\u958b\u59cb\u65e5\u6642');<\/strong>\r\n<strong>        $table-&gt;unsignedBigInteger('edit_user_id')-&gt;nullable()-&gt;comment('\u7de8\u96c6\u4e2d\u306e\u30e6\u30fc\u30b6\u30fcID');<\/strong>\r\n<strong>        $table-&gt;timestamps();<\/strong>\r\n\r\n<strong>        $table-&gt;foreign('edit_user_id')-&gt;references('id')-&gt;on('users');<\/strong>\r\n<strong>    });<\/strong>\r\n}\r\n\r\n\/\/ \u7701\u7565<\/pre>\n<h2>Seeder<\/h2>\n<p><strong>database\/seeders\/ReportSeeder.php<\/strong><\/p>\n<pre>\/\/ \u7701\u7565\r\n\r\n<strong>public function run()<\/strong>\r\n<strong>{<\/strong>\r\n<strong>    for($i = 1; $i &lt;= 25; $i++) {<\/strong>\r\n\r\n<strong>        $report = new Report();<\/strong>\r\n<strong>        $report-&gt;title = '\u30bf\u30a4\u30c8\u30eb' . $i;<\/strong>\r\n<strong>        $report-&gt;body = '\u672c\u6587' . $i;<\/strong>\r\n\r\n<strong>        if($i % 5 === 0) {<\/strong>\r\n\r\n<strong>            \/\/ 5\u306e\u500d\u6570\u306e\u30ec\u30b3\u30fc\u30c9\u306f\u7de8\u96c6\u4e2d\u306b\u3059\u308b<\/strong>\r\n<strong>            $report-&gt;edit_started_at = now();<\/strong>\r\n<strong>            $report-&gt;edit_user_id = 2;<\/strong>\r\n\r\n<strong>        }<\/strong>\r\n\r\n<strong>        $report-&gt;save();<\/strong>\r\n\r\n<strong>    }<\/strong>\r\n<strong>}<\/strong>\r\n\r\n\/\/ \u7701\u7565<\/pre>\n<p>\u3061\u306a\u307f\u306b\u4eca\u56de\u306f\u30c6\u30b9\u30c8\u3067\u3059\u306e\u3067\u3001<code>ID<\/code>\u304c<code>5<\/code>\u306e\u500d\u6570\u306e\u5834\u5408\uff085, 10, 15&#8230;\uff09\u306f\u300c\u73fe\u5728\u7de8\u96c6\u4e2d\u300d\u306b\u306a\u308b\u3088\u3046\u306b\u30c7\u30fc\u30bf\u3092\u3064\u304f\u3063\u3066\u3044\u307e\u3059\u3002\uff08\u7279\u306b\u610f\u5473\u306f\u306a\u3044\u3067\u3059\u304c\u3001\u540c\u3058\u30c7\u30fc\u30bf\u3070\u304b\u308a\u3082\u4f55\u306a\u306e\u3067\u2026\uff09<\/p>\n<p><code>Seeder<\/code>\u306f\u4f5c\u6210\u3057\u305f\u3060\u3051\u3067\u306f\u5b9f\u884c\u3067\u304d\u307e\u305b\u3093\u306e\u3067\u3001<code>DatabaseSeeder.php<\/code>\u306b\u767b\u9332\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<p><strong>database\/seeders\/DatabaseSeeder.php<\/strong><\/p>\n<pre>\/\/ \u7701\u7565\r\n\r\npublic function run()\r\n{\r\n    \/\/ \u7701\u7565\r\n    <strong>$this-&gt;call(ReportSeeder::class); \/\/ \ud83d\udc48 \u3053\u3053\u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f<\/strong>\r\n}\r\n\r\n\/\/ \u7701\u7565<\/pre>\n<p>\u3067\u306f\u3053\u306e\u72b6\u614b\u3067<code>DB<\/code>\u3092\u518d\u69cb\u7bc9\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>php artisan migrate:fresh --seed<\/strong><\/pre>\n<p>\u3059\u308b\u3068\u3001\u5b9f\u969b\u306e\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-11104\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/10\/laravel_react_coedit_1.png\" alt=\"\" width=\"541\" height=\"421\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/10\/laravel_react_coedit_1.png 541w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/10\/laravel_react_coedit_1-300x233.png 300w\" sizes=\"auto, (max-width: 541px) 100vw, 541px\" \/><\/p>\n<h2>\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc<\/h2>\n<p><strong>app\/Http\/Controllers\/ReportController.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\\Report;<\/strong>\r\n<strong>use Illuminate\\Http\\Request;<\/strong>\r\n<strong>use Inertia\\Inertia;<\/strong>\r\n\r\n<strong>class ReportController extends Controller<\/strong>\r\n<strong>{<\/strong>\r\n<strong>    public function index()<\/strong>\r\n<strong>    {<\/strong>\r\n<strong>        $reports = Report::query()<\/strong>\r\n<strong>            -&gt;select('id', 'title')<\/strong>\r\n<strong>            -&gt;paginate(5);<\/strong>\r\n\r\n<strong>        return Inertia::render('Report\/Index')-&gt;with([<\/strong>\r\n<strong>            'reports' =&gt; $reports<\/strong>\r\n<strong>        ]);<\/strong>\r\n<strong>    }<\/strong>\r\n\r\n<strong>    public function edit(Report $report)<\/strong>\r\n<strong>    {<\/strong>\r\n<strong>        return Inertia::render('Report\/Edit')-&gt;with([<\/strong>\r\n<strong>            'report' =&gt; $report<\/strong>\r\n<strong>        ]);<\/strong>\r\n<strong>    }<\/strong>\r\n\r\n<strong>    public function update(Report $report, Request $request)<\/strong>\r\n<strong>    {<\/strong>\r\n<strong>        \/\/ \u6ce8\uff1a \u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u306f\u7701\u7565\u3057\u3066\u3044\u307e\u3059<\/strong>\r\n\r\n<strong>        $report-&gt;title = $request-&gt;title;<\/strong>\r\n<strong>        $report-&gt;body = $request-&gt;body;<\/strong>\r\n<strong>        $report-&gt;edit_started_at = null;<\/strong>\r\n<strong>        $report-&gt;edit_user_id = null;<\/strong>\r\n<strong>        $report-&gt;save();<\/strong>\r\n\r\n<strong>        return redirect()-&gt;route('report.index');<\/strong>\r\n<strong>    }<\/strong>\r\n\r\n<strong>    public function take_over(Report $report)<\/strong>\r\n<strong>    {<\/strong>\r\n<strong>        $report-&gt;edit_started_at = now();<\/strong>\r\n<strong>        $report-&gt;edit_user_id = auth()-&gt;id();<\/strong>\r\n<strong>        $report-&gt;save();<\/strong>\r\n\r\n<strong>        return redirect()-&gt;route('report.edit', $report);<\/strong>\r\n<strong>    }<\/strong>\r\n<strong>}<\/strong><\/pre>\n<p>\u3053\u306e\u4e2d\u3067\u3084\u3063\u3066\u3044\u308b\u3053\u3068\u306f<code>Intertia<\/code>\u3092\u4f7f\u3063\u305f\u57fa\u672c\u7684\u306a\u8868\u793a\uff06\u7de8\u96c6\u306e\u30b3\u30fc\u30c9\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u304c\u3001<code>take_over()<\/code>\u306f\u300c<strong>\u7de8\u96c6\u6a29\u3092\u4ed6\u306e\u30e6\u30fc\u30b6\u30fc\u304b\u3089\u596a\u3044\u53d6\u308b\u3001\u5f15\u304d\u7d99\u304e\u6a5f\u80fd<\/strong>\u300d\u3068\u3057\u3066\u5229\u7528\u3057\u307e\u3059\u3002<\/p>\n<h1>\u30df\u30c9\u30eb\u30a6\u30a7\u30a2\u3092\u3064\u304f\u308b<\/h1>\n<p>\u3067\u306f\u6b21\u306b\u3001\u524d\u56de\u5229\u7528\u3057\u305f<code>Laravel Precognition<\/code>\u3092\u4f7f\u3063\u3066\u300c<strong>\u30b3\u30f3\u30d5\u30ea\u30af\u30c8\uff08\u7de8\u96c6\u306e\u885d\u7a81\uff09<\/strong>\u300d\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u30df\u30c9\u30eb\u30a6\u30a7\u30a2\u3092\u4f5c\u3063\u3066\u3044\u304d\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>php artisan make:middleware ReportConfilictMiddleware<\/strong><\/pre>\n<p>\u3059\u308b\u3068\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<\/p>\n<p><strong>app\/Http\/Middleware\/ReportConflictMiddleware.php<\/strong><\/p>\n<pre>\/\/ \u7701\u7565\r\n\r\n<strong>public function handle(Request $request, Closure $next)<\/strong>\r\n<strong>{<\/strong>\r\n<strong>    if($request-&gt;isAttemptingPrecognition()) {<\/strong>\r\n\r\n<strong>        $user_id = auth()-&gt;id();<\/strong>\r\n<strong>        $report = $request-&gt;route('report');<\/strong>\r\n\r\n<strong>        if(! is_null($report)) {<\/strong>\r\n\r\n<strong>            $dt = now()-&gt;subMinutes(1); \/\/ 1\u5206\u524d<\/strong>\r\n\r\n<strong>            if($report-&gt;is_editing_by_others === true &amp;&amp; $report-&gt;edit_started_at &gt;= $dt) { \/\/ \u4ed6\u306e\u4eba\u304c\u7de8\u96c6\u4e2d<\/strong>\r\n\r\n<strong>                return response('Locked', 423, [<\/strong>\r\n<strong>                    'Edit-User-Name' =&gt; urlencode($report-&gt;edit_user-&gt;name), \/\/ \u30d8\u30c3\u30c0\u30fc\u306f\u30a8\u30f3\u30b3\u30fc\u30c9\u3057\u3066\u304a\u304f<\/strong>\r\n<strong>                ]);<\/strong>\r\n\r\n<strong>            } else {<\/strong>\r\n\r\n<strong>                $report-&gt;edit_started_at = now();<\/strong>\r\n<strong>                $report-&gt;edit_user_id = $user_id;<\/strong>\r\n<strong>                $report-&gt;save();<\/strong>\r\n\r\n<strong>            }<\/strong>\r\n\r\n<strong>            return response('OK', 200);<\/strong>\r\n\r\n<strong>        }<\/strong>\r\n\r\n<strong>    }<\/strong>\r\n\r\n<strong>    return $next($request);<\/strong>\r\n<strong>}<\/strong>\r\n\r\n\/\/ \u7701\u7565<\/pre>\n<p>\u3053\u306e\u4e2d\u3067\u3084\u3063\u3066\u3044\u308b\u3053\u3068\u306f\u3001\u307e\u305a<code>isAttemptingPrecognition()<\/code>\u3067\u300c<strong>Precognition<\/strong>\u300d\u30e2\u30fc\u30c9\u304b\u3069\u3046\u304b\u3092\u30c1\u30a7\u30c3\u30af\u3057\u3001\u3082\u3057\u305d\u3046\u306a\u3089\u30da\u30fc\u30b8\u304c\u30ed\u30c3\u30af\u3055\u308c\u3066\u3044\u308b\u304b\u3069\u3046\u304b\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u6d41\u308c\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u306a\u304a\u3001\u30d1\u30bf\u30fc\u30f3\u306b\u3088\u3063\u3066HTTP\u30b9\u30c6\u30fc\u30bf\u30b9\u30b3\u30fc\u30c9\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5207\u308a\u66ff\u308f\u308a\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u30ed\u30c3\u30af\u3055\u308c\u3066\u306a\u3044\uff1a 200<\/li>\n<li>\u30ed\u30c3\u30af\u3055\u308c\u3066\u3044\u308b\uff1a 423<\/li>\n<\/ul>\n<p>\u307e\u305f\u3001\u30ec\u30b9\u30dd\u30f3\u30b9\u30d8\u30c3\u30c0\u30fc\u306b\u300c<strong>Edit-User-Name<\/strong>\u300d\u3068\u3044\u3046\u9805\u76ee\u3092\u8ffd\u52a0\u3057\u3066\u3044\u307e\u3059\u304c\u3001\u3053\u306e\u540d\u524d\u304c\u300c<strong>\u25cf\u25cf\u3055\u3093\u306b\u3088\u3063\u3066\u66f4\u65b0\u3055\u308c\u3066\u3044\u307e\u3059<\/strong>\u300d\u3068\u3044\u3046\u8868\u793a\u306b\u4f7f\u308f\u308c\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h1>\u30d3\u30e5\u30fc\u3092\u3064\u304f\u308b<\/h1>\n<p>\u3067\u306f\u3001\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3067\u6307\u5b9a\u3057\u305f\uff12\u3064\u306e\u30d3\u30e5\u30fc\u3092\u3064\u304f\u3063\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><strong>resources\/js\/Pages\/Report\/Index.jsx<\/strong><\/p>\n<pre><strong>export default function Index(props) {<\/strong>\r\n\r\n<strong>    const reports = props.reports.data;<\/strong>\r\n<strong>    const paginationLinks = props.reports.links;<\/strong>\r\n\r\n<strong>    return (<\/strong>\r\n<strong>        &lt;div className=\"p-5\"&gt;<\/strong>\r\n<strong>            &lt;h1 className=\"font-medium mb-3\"&gt;\u5831\u544a\u66f8\u4e00\u89a7&lt;\/h1&gt;<\/strong>\r\n<strong>            &lt;table className=\"text-sm text-left text-gray-500 mb-7 w-80\"&gt;<\/strong>\r\n<strong>                &lt;thead&gt;<\/strong>\r\n<strong>                &lt;tr className=\"bg-gray-100\"&gt;<\/strong>\r\n<strong>                    &lt;th className=\"py-3 px-6\"&gt;\u30bf\u30a4\u30c8\u30eb&lt;\/th&gt;<\/strong>\r\n<strong>                    &lt;th className=\"py-3 px-6\"&gt;\u64cd\u4f5c&lt;\/th&gt;<\/strong>\r\n<strong>                &lt;\/tr&gt;<\/strong>\r\n<strong>                &lt;\/thead&gt;<\/strong>\r\n<strong>                &lt;tbody&gt;<\/strong>\r\n<strong>                {reports &amp;&amp; reports.map(report =&gt; (<\/strong>\r\n<strong>                    &lt;tr key={report.id} className=\"bg-white border-b\"&gt;<\/strong>\r\n<strong>                        &lt;td className=\"py-3 px-6\"&gt;{report.title}&lt;\/td&gt;<\/strong>\r\n<strong>                        &lt;td className=\"py-3 px-6\"&gt;<\/strong>\r\n<strong>                            &lt;a href={route('report.edit', report.id)} className=\"text-white bg-blue-500 text-xs rounded text-sm px-1.5 py-1 mr-2 mb-2\"&gt;\u5909\u66f4&lt;\/a&gt;<\/strong>\r\n<strong>                        &lt;\/td&gt;<\/strong>\r\n<strong>                    &lt;\/tr&gt;<\/strong>\r\n<strong>                ))}<\/strong>\r\n<strong>                &lt;\/tbody&gt;<\/strong>\r\n<strong>            &lt;\/table&gt;<\/strong>\r\n<strong>            &lt;nav&gt;<\/strong>\r\n<strong>                &lt;ul&gt;<\/strong>\r\n<strong>                    &lt;li&gt;<\/strong>\r\n<strong>                    {paginationLinks &amp;&amp; paginationLinks.map((link,index) =&gt; (<\/strong>\r\n<strong>                        link.active &amp;&amp; (<\/strong>\r\n<strong>                            &lt;a<\/strong>\r\n<strong>                                key={index}<\/strong>\r\n<strong>                                className=\"py-2 px-3 text-blue-600 bg-blue-50 border border-gray-300\"&gt;{link.label}&lt;\/a&gt;<\/strong>\r\n<strong>                        ) || (<\/strong>\r\n<strong>                            &lt;a<\/strong>\r\n<strong>                                key={index}<\/strong>\r\n<strong>                                href={link.url}<\/strong>\r\n<strong>                                dangerouslySetInnerHTML={{__html: link.label}}<\/strong>\r\n<strong>                                className=\"py-2 px-3 leading-tight text-gray-500 bg-white border border-gray-300\"&gt;&lt;\/a&gt;<\/strong>\r\n<strong>                        )<\/strong>\r\n\r\n<strong>                    ))}<\/strong>\r\n<strong>                    &lt;\/li&gt;<\/strong>\r\n<strong>                &lt;\/ul&gt;<\/strong>\r\n<strong>            &lt;\/nav&gt;<\/strong>\r\n\r\n\r\n<strong>        &lt;\/div&gt;<\/strong>\r\n<strong>    );<\/strong>\r\n\r\n<strong>}<\/strong><\/pre>\n<p>\u3053\u306e\u30d3\u30e5\u30fc\u306f\u5831\u544a\u66f8\u306e\u4e00\u89a7\u3092\u8868\u793a\u3059\u308b\u305f\u3081\u306e\u3082\u306e\u3067\u3059\u3002<\/p>\n<p>\u5185\u90e8\u7684\u306b\u306f\u5927\u304d\u304f\u4ee5\u4e0b\uff12\u3064\u306e\u30d6\u30ed\u30c3\u30af\u306b\u5206\u304b\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<ul>\n<li>Laravel \u3067\u53d6\u5f97\u3055\u308c\u305f\u30c7\u30fc\u30bf\u3092\u30eb\u30fc\u30d7\u3067\uff11\u3064\u305a\u3064\u53d6\u308a\u51fa\u3057\u8868\u793a<\/li>\n<li>\u30da\u30fc\u30b8\u30ea\u30f3\u30af\u3092\u8868\u793a\u3059\u308b<\/li>\n<\/ul>\n<p><strong>resources\/js\/Pages\/Report\/Edit.jsx<\/strong><\/p>\n<pre><strong>import {useEffect, useState} from 'react';<\/strong>\r\n<strong>import {Inertia} from '@inertiajs\/inertia';<\/strong>\r\n<strong>import axios from 'axios';<\/strong>\r\n\r\n<strong>export default function Edit(props) {<\/strong>\r\n\r\n<strong>    \/\/ \u30d5\u30a9\u30fc\u30e0\u30c7\u30fc\u30bf<\/strong>\r\n<strong>    const [title, setTitle] = useState(props.report.title);<\/strong>\r\n<strong>    const [body, setBody] = useState(props.report.body);<\/strong>\r\n\r\n<strong>    \/\/ \u30b3\u30f3\u30d5\u30ea\u30af\u30c8\uff08\u7de8\u96c6\u4e2d\u304b\u3069\u3046\u304b\uff09<\/strong>\r\n<strong>    const [hasConflict, setHasConflict] = useState(false);<\/strong>\r\n<strong>    const [editUserName, setEditUserName] = useState('');<\/strong>\r\n<strong>    const checkConflict = () =&gt; {<\/strong>\r\n\r\n<strong>        if(submitting === true) return; \/\/ \u30d5\u30a9\u30fc\u30e0\u306e\u9001\u4fe1\u4e2d\u306f\u30c1\u30a7\u30c3\u30af\u3057\u306a\u3044<\/strong>\r\n\r\n<strong>        const url = route('report.update', props.report.id);<\/strong>\r\n<strong>        const data = { _method: 'PUT' };<\/strong>\r\n<strong>        const config = {<\/strong>\r\n<strong>            headers:{<\/strong>\r\n<strong>                Accept: 'application\/json',<\/strong>\r\n<strong>                Precognition: 'true',<\/strong>\r\n<strong>            }<\/strong>\r\n<strong>        };<\/strong>\r\n\r\n<strong>        axios.post(url, data, config)<\/strong>\r\n<strong>            .then(response =&gt; {<\/strong>\r\n\r\n<strong>                const status = response.status;<\/strong>\r\n\r\n<strong>                if(status === 200) {<\/strong>\r\n\r\n<strong>                    setHasConflict(boolean =&gt; {<\/strong>\r\n\r\n<strong>                        if(boolean === true) {<\/strong>\r\n\r\n<strong>                            location.reload(); \/\/ \u30ed\u30c3\u30af \u2192 \u89e3\u9664\u306e\u5834\u5408\u3001\u30c7\u30fc\u30bf\u66f4\u65b0\u3059\u308b\u305f\u3081\u30ea\u30ed\u30fc\u30c9<\/strong>\r\n\r\n<strong>                        } else {<\/strong>\r\n\r\n<strong>                            return false;<\/strong>\r\n\r\n<strong>                        }<\/strong>\r\n\r\n<strong>                    });<\/strong>\r\n\r\n<strong>                }<\/strong>\r\n\r\n<strong>            })<\/strong>\r\n<strong>            .catch(error =&gt; {<\/strong>\r\n\r\n<strong>               const status = error.response.status;<\/strong>\r\n<strong>               const userName = decodeURIComponent(error.response.headers['edit-user-name']);<\/strong>\r\n<strong>               setEditUserName(userName);<\/strong>\r\n\r\n<strong>               if(status === 423) {<\/strong>\r\n\r\n<strong>                   setHasConflict(true);<\/strong>\r\n\r\n<strong>               }<\/strong>\r\n\r\n<strong>            });<\/strong>\r\n\r\n<strong>    };<\/strong>\r\n<strong>    useEffect(() =&gt; {<\/strong>\r\n\r\n<strong>        checkConflict();<\/strong>\r\n<strong>        const interval = setInterval(checkConflict, 3000);<\/strong>\r\n\r\n<strong>        return () =&gt; {<\/strong>\r\n\r\n<strong>            clearInterval(interval); \/\/ \u30bf\u30a4\u30de\u30fc\u304c\u6b62\u307e\u3089\u306a\u304f\u306a\u308b\u306e\u3067\u3001\u3053\u3053\u3067\u660e\u793a\u7684\u306b\u30b9\u30c8\u30c3\u30d7<\/strong>\r\n\r\n<strong>        };<\/strong>\r\n\r\n<strong>    }, []);<\/strong>\r\n\r\n<strong>    \/\/ Take over<\/strong>\r\n<strong>    const handleTakeOver = () =&gt; {<\/strong>\r\n\r\n<strong>        const url = route('report.take_over', props.report.id);<\/strong>\r\n<strong>        const params = {<\/strong>\r\n<strong>            _method: 'PATCH'<\/strong>\r\n<strong>        };<\/strong>\r\n<strong>        const options = {<\/strong>\r\n<strong>            onSuccess() {<\/strong>\r\n\r\n<strong>                location.reload();<\/strong>\r\n\r\n<strong>            }<\/strong>\r\n<strong>        };<\/strong>\r\n<strong>        Inertia.post(url, params, options);<\/strong>\r\n\r\n<strong>    };<\/strong>\r\n\r\n<strong>    \/\/ Submit<\/strong>\r\n<strong>    const [submitting, setSubmitting] = useState(false);<\/strong>\r\n<strong>    const handleSubmit = () =&gt; {<\/strong>\r\n\r\n<strong>        setSubmitting(true);<\/strong>\r\n\r\n<strong>        const url = route('report.update', props.report.id);<\/strong>\r\n<strong>        const data = {<\/strong>\r\n<strong>            _method: 'PUT',<\/strong>\r\n<strong>            title: title,<\/strong>\r\n<strong>            body: body,<\/strong>\r\n<strong>        }<\/strong>\r\n<strong>        const options = {<\/strong>\r\n<strong>            onFinish() {<\/strong>\r\n\r\n<strong>                setSubmitting(false);<\/strong>\r\n\r\n<strong>            }<\/strong>\r\n<strong>        };<\/strong>\r\n<strong>        Inertia.post(url, data, options);<\/strong>\r\n\r\n<strong>    };<\/strong>\r\n\r\n<strong>    return (<\/strong>\r\n<strong>        &lt;div className=\"p-5\"&gt;<\/strong>\r\n<strong>            {hasConflict &amp;&amp; (<\/strong>\r\n<strong>                &lt;div className=\"bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded mb-3\"&gt;<\/strong>\r\n<strong>                    &lt;div className=\"block mb-2\"&gt;{editUserName} \u3055\u3093\u306b\u3088\u3063\u3066\u66f4\u65b0\u3055\u308c\u3066\u3044\u307e\u3059&lt;\/div&gt;<\/strong>\r\n<strong>                    &lt;a<\/strong>\r\n<strong>                        href=\"#\"<\/strong>\r\n<strong>                        className=\"text-white bg-gray-500 font-medium rounded text-xs px-3 py-2\"<\/strong>\r\n<strong>                        onClick={handleTakeOver}&gt;\u5f15\u304d\u7d99\u3050&lt;\/a&gt;<\/strong>\r\n<strong>                &lt;\/div&gt;<\/strong>\r\n<strong>            ) || (<\/strong>\r\n<strong>                &lt;&gt;<\/strong>\r\n<strong>                    &lt;div className=\"mb-4\"&gt;<\/strong>\r\n<strong>                        &lt;label&gt;\u30bf\u30a4\u30c8\u30eb&lt;\/label&gt;<\/strong>\r\n<strong>                        &lt;br \/&gt;<\/strong>\r\n<strong>                        &lt;input type=\"text\" value={title} onChange={e =&gt; setTitle(e.target.value)} \/&gt;<\/strong>\r\n<strong>                    &lt;\/div&gt;<\/strong>\r\n<strong>                    &lt;div className=\"mb-4\"&gt;<\/strong>\r\n<strong>                        &lt;label&gt;\u5831\u544a\u5185\u5bb9&lt;\/label&gt;<\/strong>\r\n<strong>                        &lt;br \/&gt;<\/strong>\r\n<strong>                        &lt;textarea value={body} onChange={e =&gt; setBody(e.target.value)} \/&gt;<\/strong>\r\n<strong>                    &lt;\/div&gt;<\/strong>\r\n<strong>                    &lt;button<\/strong>\r\n<strong>                        type=\"button\"<\/strong>\r\n<strong>                        className=\"text-white bg-blue-700 font-medium rounded text-sm px-5 py-2.5 mr-2 mb-2\"<\/strong>\r\n<strong>                        onClick={handleSubmit}&gt;<\/strong>\r\n<strong>                        \u9001\u4fe1<\/strong>\r\n<strong>                    &lt;\/button&gt;<\/strong>\r\n<strong>                    &lt;a href={route('report.index')} className=\"ml-4 text-blue-700 underline\"&gt;\u623b\u308b&lt;\/a&gt;<\/strong>\r\n<strong>                &lt;\/&gt;<\/strong>\r\n<strong>            )}<\/strong>\r\n<strong>        &lt;\/div&gt;<\/strong>\r\n<strong>    );<\/strong>\r\n\r\n<strong>}<\/strong><\/pre>\n<p>\u3053\u3061\u3089\u304c\u4eca\u56de\u306e\u30e1\u30a4\u30f3\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<br \/>\n\u30b3\u30f3\u30d5\u30ea\u30af\u30c8\u306f\u4ee5\u4e0b\u306e\u6d41\u308c\u3067\u30c1\u30a7\u30c3\u30af\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<ol>\n<li>checkConflict() \u3092\uff13\u79d2\u304a\u304d\u306b\u5b9f\u884c<\/li>\n<li>checkConflict() \u306e\u4e2d\u3067 Precognition \u30e2\u30fc\u30c9\u3067\u30a2\u30af\u30bb\u30b9<\/li>\n<li>\u3082\u3057\u30ed\u30c3\u30af\u3055\u308c\u3066\u3044\u305f\u3089\u7de8\u96c6\u3067\u304d\u306a\u304f\u3059\u308b<\/li>\n<\/ol>\n<p>\u307e\u305f\u3001\u3082\u3057\u30ed\u30c3\u30af\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u3067\u3082\uff13\u79d2\u304a\u304d\u306b\u30c1\u30a7\u30c3\u30af\u3092\u7d9a\u3051\u3001\u3082\u3057\u76f8\u624b\u65b9\u306e\u7de8\u96c6\u304c\u7d42\u308f\u3063\u305f\u3089\uff08\u30ed\u30c3\u30af\u304c\u89e3\u9664\u3055\u308c\u305f\u3089\uff09\u81ea\u52d5\u3067\u30da\u30fc\u30b8\u3092\u30ea\u30ed\u30fc\u30c9\u3057\u3001\u7de8\u96c6\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u306a\u304a\u3001\u4eca\u56de\u306e\u30c6\u30fc\u30de\u3068\u306f\u76f4\u63a5\u95a2\u4fc2\u306a\u3044\u306e\u3067\u3059\u304c<code>useEffect()<\/code>\u306e\u4e2d\u3067<code>setInterval()<\/code>\u3092\u4f7f\u3046\u5834\u5408\u306f\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u306a\u305c\u306a\u3089\u3001<strong>\u7e70\u308a\u8fd4\u3057\u5b9f\u884c\u3059\u308b\u90e8\u5206\u304c\u6b62\u307e\u3089\u306a\u304f\u306a\u308b\u53ef\u80fd\u6027\u304c\u3042\u308b<\/strong>\u304b\u3089\u3067\u3059\u3002<\/p>\n<p>\u305d\u306e\u305f\u3081\u3001\u4eca\u56de\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u300c<strong>\u30af\u30ea\u30fc\u30f3\u30a2\u30c3\u30d7<\/strong>\u300d\u95a2\u6570\u3092\u4f7f\u3063\u3066\u660e\u793a\u7684\u306b\u30bf\u30a4\u30de\u30fc\u3092\u89e3\u9664\u3057\u3066\u3044\u307e\u3059\u3002\uff08\u7121\u3044\u5834\u5408\u3001\u30b3\u30f3\u30bd\u30fc\u30eb\u306b\u8b66\u544a\u304c\u51fa\u307e\u3059\uff09<\/p>\n<pre>useEffect(() =&gt; {\r\n\r\n    checkConflict();\r\n    const <strong>interval<\/strong> = setInterval(checkConflict, 3000);\r\n\r\n    return () =&gt; {\r\n\r\n        <strong>clearInterval(interval); \/\/ \ud83d\udc48 \u3053\u308c<\/strong>\r\n\r\n    };\r\n\r\n}, []);<\/pre>\n<h1>\u30eb\u30fc\u30c8\u3092\u3064\u304f\u308b<\/h1>\n<p>\u6b21\u306b\u3001\u5148\u307b\u3069\u3064\u304f\u3063\u305f\u30df\u30c9\u30eb\u30a6\u30a7\u30a2\u3092\u4f7f\u3063\u3066\u30eb\u30fc\u30c8\u3092\u3064\u304f\u3063\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p><strong>routes\/web.php<\/strong><\/p>\n<pre>\/\/ \u7701\u7565<strong>\r\n\r\nuse App\\Http\\Controllers\\ReportController;<\/strong>\r\n<strong>use App\\Http\\Middleware\\ReportConflictMiddleware;<\/strong>\r\n\r\n\/\/ \u7701\u7565\r\n\r\n<strong>Route::prefix('report')-&gt;middleware('auth')-&gt;controller(ReportController::class)-&gt;group(function(){<\/strong>\r\n\r\n<strong>    Route::get('\/', 'index')-&gt;name('report.index');<\/strong>\r\n<strong>    Route::get('\/{report}\/edit', 'edit')-&gt;name('report.edit');<\/strong>\r\n<strong>    Route::put('\/{report}', 'update')<\/strong>\r\n<strong>        -&gt;middleware([ReportConflictMiddleware::class])<\/strong>\r\n<strong>        -&gt;name('report.update');<\/strong>\r\n<strong>    Route::patch('\/{report}\/take_over', 'take_over')-&gt;name('report.take_over');<\/strong>\r\n\r\n<strong>});<\/strong><\/pre>\n<p>\u3053\u308c\u3067\u4f5c\u696d\u306f\u5b8c\u4e86\u3067\u3059\u2757<br \/>\n\u304a\u75b2\u308c\u69d8\u3067\u3057\u305f\ud83d\ude04\u2728<\/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\u3002<\/p>\n<p>\u307e\u305a<code>Vite<\/code>\u3092\u8d77\u52d5\u3057\u3066\u3001\u3069\u306e\u30e6\u30fc\u30b6\u30fc\u3067\u3082\u3044\u3044\u306e\u3067\u30ed\u30b0\u30a4\u30f3\u3057\u3066\u300c<strong>http:\/\/******\/report<\/strong>\u300d\u3078\u30a2\u30af\u30bb\u30b9\u3057\u307e\u3059\u3002<\/p>\n<p>\u307e\u305f\u3001\u30d6\u30e9\u30a6\u30b6\u3092\uff08<code>Google Chrome<\/code>\u306e\u5834\u5408\u306f\uff09\u300c<strong>\u30b7\u30fc\u30af\u30ec\u30c3\u30c8\u30e2\u30fc\u30c9<\/strong>\u300d\u3067\u958b\u304d\u5225\u306e\u30e6\u30fc\u30b6\u30fc\u3067\u30ed\u30b0\u30a4\u30f3\uff06\u540c\u3058URL\u3078\u30a2\u30af\u30bb\u30b9\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u203b \u3053\u308c\u306f\u3001\u30b7\u30fc\u30af\u30ec\u30c3\u30c8\u30e2\u30fc\u30c9\u304c\u307e\u3063\u305f\u304f\u5225\u74b0\u5883\u3068\u3057\u3066\u6271\u308f\u308c\u308b\u3001\u3064\u307e\u308a\u5225\u306e\u30e6\u30fc\u30b6\u30fc\u304c\u540c\u6642\u306b\u30ed\u30b0\u30a4\u30f3\u3057\u305f\u72b6\u6cc1\u3092\u7c21\u5358\u306b\u3064\u304f\u308a\u3060\u3059\u30c6\u30af\u30cb\u30c3\u30af\u3067\u3059\u3002<\/p>\n<p>\u3067\u306f\u3001\u30a2\u30af\u30bb\u30b9\u3057\u305f\u3068\u304d\u306e\u30da\u30fc\u30b8\u3067\u3059\u3002<br \/>\n\u5de6\u304c\u592a\u90ce\u3055\u3093\u3001\u53f3\u304c\u6b21\u90ce\u3055\u3093\u3067\u30ed\u30b0\u30a4\u30f3\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11108\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/10\/laravel_react_coedit_2.png\" alt=\"\" width=\"640\" height=\"285\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/10\/laravel_react_coedit_2.png 640w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/10\/laravel_react_coedit_2-300x134.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>\u3067\u306f\u3001\u300c\u30bf\u30a4\u30c8\u30eb\uff11\u300d\u306e\u5909\u66f4\u30dc\u30bf\u30f3\u3092<\/p>\n<ol>\n<li>\u592a\u90ce\u3055\u3093<\/li>\n<li>\u6b21\u90ce\u3055\u3093<\/li>\n<\/ol>\n<p>\u306e\u9806\u3067\u30af\u30ea\u30c3\u30af\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/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-11109\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/10\/laravel_react_coedit_3.png\" alt=\"\" width=\"625\" height=\"273\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/10\/laravel_react_coedit_3.png 625w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/10\/laravel_react_coedit_3-300x131.png 300w\" sizes=\"auto, (max-width: 625px) 100vw, 625px\" \/><\/p>\n<p>\u306f\u3044\u2757<br \/>\n\u592a\u90ce\u3055\u3093\u306f\u7de8\u96c6\u30d5\u30a9\u30fc\u30e0\u304c\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u306e\u306b\u5bfe\u3057\u3001\u6b21\u90ce\u3055\u3093\u306e\u65b9\u306f\u300c<strong>\u592a\u90ce\u3055\u3093\u306b\u3088\u3063\u3066\u66f4\u65b0\u3055\u308c\u3066\u3044\u307e\u3059<\/strong>\u300d\u3068\u8868\u793a\u3055\u308c\u7de8\u96c6\u304c\u30ed\u30c3\u30af\u3055\u308c\u3066\u3044\u308b\u72b6\u614b\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3067\u306f\u3001\u6b21\u306b\u592a\u90ce\u3055\u3093\u306e\u300c<strong>\u5831\u544a\u5185\u5bb9<\/strong>\u300d\u3092\u300c<strong>\u672c\u6587\uff11\u30fb\u5909\u66f4\u6e08\u307f by \u592a\u90ce<\/strong>\u300d\u3068\u5909\u66f4\u3057\u3066\u300c<strong>\u9001\u4fe1<\/strong>\u300d\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11110\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/10\/laravel_react_coedit_4.png\" alt=\"\" width=\"254\" height=\"262\" \/><\/p>\n<p>\u3069\u3046\u306a\u308b\u3067\u3057\u3087\u3046\u304b\u30fb\u30fb\u30fb\u30fb\u30fb\u30fb<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11111\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/10\/laravel_react_coedit_5.png\" alt=\"\" width=\"651\" height=\"278\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/10\/laravel_react_coedit_5.png 651w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/10\/laravel_react_coedit_5-300x128.png 300w\" sizes=\"auto, (max-width: 651px) 100vw, 651px\" \/><\/p>\n<p>\u306f\u3044\u2757<br \/>\n\u5de6\u5074\u306e\u592a\u90ce\u3055\u3093\u306f\u4e00\u89a7\u30da\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u3001\u6570\u79d2\u3057\u3066\u304b\u3089\u6b21\u90ce\u3055\u3093\u306e\u30da\u30fc\u30b8\u3082\u81ea\u52d5\u7684\u306b\u7de8\u96c6\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002\u307e\u305f\u3001\u5831\u544a\u5185\u5bb9\u306e\u4e2d\u8eab\u3082\u5148\u307b\u3069\u592a\u90ce\u3055\u3093\u304c\u4fdd\u5b58\u3057\u305f\u3082\u306e\u304c\u8868\u793a\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3067\u306f\u6b21\u306b\u5f15\u304d\u7d99\u304e\u6a5f\u80fd\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u305f\u3081\u306b\u3001\u518d\u5ea6\u592a\u90ce\u3055\u3093\u3067\u300c<strong>\u30bf\u30a4\u30c8\u30eb\uff11<\/strong>\u300d\u306e\u5909\u66f4\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p>\u3059\u308b\u3068\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5148\u307b\u3069\u3068\u306f\u9006\u306b\u300c<strong>\u6b21\u90ce\u3055\u3093\u306b\u3088\u3063\u3066\u66f4\u65b0\u3055\u308c\u3066\u3044\u307e\u3059<\/strong>\u300d\u3068\u8868\u793a\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u4eca\u56de\u306f\u300c<strong>\u5f15\u304d\u7d99\u3050<\/strong>\u300d\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11112\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/10\/laravel_react_coedit_6.png\" alt=\"\" width=\"651\" height=\"278\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/10\/laravel_react_coedit_6.png 651w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/10\/laravel_react_coedit_6-300x128.png 300w\" sizes=\"auto, (max-width: 651px) 100vw, 651px\" \/><\/p>\n<p>\u3046\u307e\u304f\u3044\u304f\u3067\u3057\u3087\u3046\u304b\u30fb\u30fb\u30fb\u30fb\u30fb\u30fb\uff1f\uff1f<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11113\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/10\/laravel_react_coedit_7.png\" alt=\"\" width=\"651\" height=\"278\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/10\/laravel_react_coedit_7.png 651w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2022\/10\/laravel_react_coedit_7-300x128.png 300w\" sizes=\"auto, (max-width: 651px) 100vw, 651px\" \/><\/p>\n<p>\u306f\u3044\u2757<br \/>\n\u6b21\u90ce\u3055\u3093\u306e\u6301\u3063\u3066\u3044\u305f\u300c<strong>\u7de8\u96c6\u6a29<\/strong>\u300d\u304c\u592a\u90ce\u3055\u3093\u306b\u79fb\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>\u3059\u3079\u3066\u6210\u529f\u3067\u3059\ud83d\ude04\u2728<\/p>\n<h1>\u4f01\u696d\u69d8\u3078\u306e\u3054\u63d0\u6848<\/h1>\n<p>\u4eca\u56de\u306e\u30ed\u30c3\u30af\u6a5f\u80fd\u3092\u4f7f\u3046\u3068\u3001\u7279\u306b\u30ea\u30e2\u30fc\u30c8\u30ef\u30fc\u30af\u3067\u4f5c\u696d\u3092\u9032\u3081\u308b\u5834\u5408\u3067\u3082\u300c<strong>\u8ab0\u304b\u306b\u4e0a\u66f8\u304d\u3055\u308c\u3061\u3083\u3063\u305f\u2026<\/strong>\u300d\u3068\u3044\u3046\u3053\u3068\u304c\u306a\u304f\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u307e\u305f\u3001\u4eca\u56de\u306f\u5b9f\u88c5\u3057\u3066\u3044\u307e\u305b\u3093\u304c\u300c<strong>\u7de8\u96c6\u9014\u4e2d\u306e\u30d5\u30a9\u30fc\u30e0\u5185\u5bb9\u3092\u5225\u306e\u30e6\u30fc\u30b6\u30fc\u306b\u5f15\u304d\u7d99\u3050<\/strong>\u300d\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u306a\u304a\u3001\u6bce\u56de\u306e\u7de8\u96c6\u5c65\u6b74\u3092\u3068\u308a\u300c<strong>\u8ab0\u304c\u4f55\u3092\u8ffd\u52a0\u30fb\u5909\u66f4\u30fb\u524a\u9664\u3057\u305f\u304b<\/strong>\u300d\u3092\u6b8b\u3059\u3053\u3068\u3082\u3067\u304d\u308b<span style=\"font-size: 1rem;\">\u305f\u3081\u3001\u300c<strong>\u8cac\u4efb\u306e\u6240\u5728<\/strong>\u300d\u3092\u660e\u78ba\u306b\u3057\u305f\u3044\u3068\u3044\u3063\u305f\u3054\u5e0c\u671b\u306b\u3082\u5bfe\u5fdc\u3067\u304d\u308b\u304b\u3068\u601d\u3044\u307e\u3059\u3002\uff08\u3082\u3061\u308d\u3093\u30c7\u30fc\u30bf\u3092\u6614\u306e\u72b6\u614b\u306b\u623b\u3059\u3053\u3068\u3082\u53ef\u80fd\u3067\u3059\uff09<\/span><\/p>\n<p>\u3082\u3057\u305d\u3046\u3044\u3063\u305f\u6a5f\u80fd\u3092\u3054\u5e0c\u671b\u3067\u3057\u305f\u3089\u305c\u3072\u304a\u554f\u3044\u5408\u308f\u305b\u304b\u3089\u3054\u9023\u7d61\u304f\u3060\u3055\u3044\u3002<br \/>\n\u304a\u5f85\u3061\u3057\u3066\u304a\u308a\u307e\u3059\u3002\ud83d\ude04\u2728<\/p>\n<h1>\u304a\u308f\u308a\u306b<\/h1>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u4eca\u56de\u306f\u300c<strong>Laravel + React<\/strong>\u300d\u3067\u30da\u30fc\u30b8\u306e\u30ed\u30c3\u30af\u6a5f\u80fd\u3092\u5b9f\u88c5\u3057\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p>\u306a\u304a\u3001<code>Precognition<\/code>\u3092\u4f7f\u308f\u306a\u304f\u3068\u3082\u5b9f\u88c5\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u3059\u304c\u3001\u30df\u30c9\u30eb\u30a6\u30a7\u30a2\u5185\u3067\u5b8c\u7d50\u3067\u304d\u308b\u306e\u306f\u3068\u3066\u3082\u4fbf\u5229\u3067\u3057\u305f\u3002<\/p>\n<p>\u305c\u3072\u7686\u3055\u3093\u3082\u3084\u3063\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u306d\u3002<\/p>\n<p>\u3067\u306f\u3067\u306f\u301c\u2757<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3405 aligncenter\" 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\" \/><\/p>\n<p style=\"text-align: center;\">\u300c\u30af\u30e9\u30d5\u30c8\u30d3\u30fc\u30eb\u306e<br \/>\n\u30de\u30b9\u30bf\u30fc\u306f<br \/>\n\u30ca\u30a4\u30b9\u30ac\u30a4\u3070\u304b\u308a\u3067\u3059\ud83c\udf7a\u300d<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u524d\u56de\u8a18\u4e8b\u306f Laravel Precognition \u3067\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u30fb\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u3092\u3064\u304f\u308b \u3067\u3001Laravel\u306e\u65b0\u6a5f\u80fd\u300cPrecognition\u300d\u3092 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.capilano-fw.com\/?p=11099\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;Laravel + React \u3067 \u5171\u540c\u7de8\u96c6\u30da\u30fc\u30b8\u306e\u30ed\u30c3\u30af\u6a5f\u80fd\u3092\u3064\u304f\u308b\uff08\u5f15\u304d\u7d99\u304e\u6a5f\u80fd\u3082\uff01\uff09&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":11116,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[247,3,118,249,248],"tags":[],"class_list":["post-11099","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\/11099","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=11099"}],"version-history":[{"count":5,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/11099\/revisions"}],"predecessor-version":[{"id":11115,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/11099\/revisions\/11115"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/media\/11116"}],"wp:attachment":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=11099"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=11099"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=11099"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}