{"id":7168,"date":"2020-04-27T15:00:40","date_gmt":"2020-04-27T06:00:40","guid":{"rendered":"https:\/\/blog.capilano-fw.com\/?p=7168"},"modified":"2020-04-27T07:29:29","modified_gmt":"2020-04-26T22:29:29","slug":"%e7%aa%93%e5%8f%a3%e3%81%ae%e5%8f%97%e4%bb%98%e7%95%aa%e5%8f%b7%e3%82%b7%e3%82%b9%e3%83%86%e3%83%a0%e3%82%92%e3%81%a4%e3%81%8f%e3%82%8b%e3%83%bblaravel%e7%b7%a8%ef%bc%88%e3%83%80%e3%82%a6%e3%83%b3","status":"publish","type":"post","link":"https:\/\/blog.capilano-fw.com\/?p=7168","title":{"rendered":"\u7a93\u53e3\u306e\u53d7\u4ed8\u756a\u53f7\u30b7\u30b9\u30c6\u30e0\u3092\u3064\u304f\u308b\u30fbLaravel\u7de8\uff08\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u53ef\uff09"},"content":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u5148\u65e5\u78ba\u5b9a\u7533\u544a\u306b\u884c\u3063\u305f\u306e\u3067\u3059\u304c\u3001\u305d\u3053\u306b\u306f\u79c1\u4ee5\u5916\u306b\u3082\u305f\u304f\u3055\u3093\u306e\u65b9\u304c\u3044\u3089\u3063\u3057\u3083\u3063\u3066\u3066\u8077\u54e1\u306e\u65b9\u3082\u5168\u529b\u3067\u5bfe\u5fdc\u3055\u308c\u3066\u3044\u308b\u3088\u3046\u3067\u3057\u305f\u3002<\/p>\n<p>\u305d\u306e\u305f\u3081\u3001\u5165\u308a\u53e3\u3067\u300c\u53d7\u4ed8\u756a\u53f7\u300d\u3092\u767a\u884c\u3057\u3066\u81ea\u5206\u306e\u9806\u756a\u304c\u6765\u308b\u306e\u3092\u5f85\u3063\u3066\u3044\u305f\u306e\u3067\u3059\u304c\u3001\u305d\u306e\u6642\u3042\u308b\u30a2\u30a4\u30c7\u30a2\u304c\u6d6e\u304b\u3073\u307e\u3057\u305f\u3002<\/p>\n<p><strong style=\"font-size: 35px;\">\u53d7\u4ed8\u756a\u53f7\u30b7\u30b9\u30c6\u30e0\u3063\u3066\u3001Laravel + Python\u3067\u3064\u304f\u308c\u308b\u3088\u306d\u2753\u2753<\/strong><\/p>\n<p>\u3068\u3002<\/p>\n<p>\u305d\u3053\u3067\u3001\u65e9\u901f<code>Amazon<\/code>\u3067\u4ee5\u4e0b\u306e<strong>\u30b5\u30fc\u30de\u30eb\u30fb\u30ec\u30b7\u30fc\u30c8\u30fb\u30d7\u30ea\u30f3\u30bf\u3092\u8cfc\u5165\uff084,499\u5186\uff09\u3057\u3066\u3084\u3063\u3066\u307f\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-7185\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/laravel_wait_system_5.png\" alt=\"\" width=\"640\" height=\"466\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/laravel_wait_system_5.png 640w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/laravel_wait_system_5-300x218.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u4eca\u56de\u306f\u30c1\u30e3\u30ec\u30f3\u30b8\u4f01\u753b\u3067\u3059\u3002<br \/>\n\u305c\u3072\u7686\u3055\u3093\u306b\u697d\u3057\u3093\u3067\u3044\u305f\u3060\u3051\u308b\u3068\u5b09\u3057\u3044\u3067\u3059\ud83d\ude0a\u2728<\/p>\n<p>\u203b\u306a\u304a\u3001\u3053\u306e\u30b7\u30b9\u30c6\u30e0\u3092\u4f7f\u3048\u3070\u30b3\u30b9\u30c8\u524a\u6e1b\u3067\u304d\u307e\u3059\u306e\u3067\u3001\u305c\u3072\u4f01\u696d\u69d8\u65b9<a href=\"https:\/\/docs.google.com\/forms\/d\/e\/1FAIpQLSdqMmc1sGcm4BaHTInlMTn-8tFf4pV1k4JV0GovSfTqUddnrg\/viewform\" target=\"_blank\" rel=\"noopener noreferrer\">\u3054\u4f9d\u983c\u304a\u5f85\u3061\u3057\u3066\u3044\u307e\u3059<\/a>\ud83d\ude0a\ud83d\udc4d\uff08\u30d6\u30e9\u30a6\u30b6\u3092\u4f7f\u3046\u306e\u3067\u901a\u5e38\u306e\u30d1\u30bd\u30b3\u30f3\u3084<code>iPad<\/code>\u3067\u904b\u7528\u3067\u304d\u307e\u3059\u2757\uff09<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6066 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/03\/no_23.png\" alt=\"\" width=\"370\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/03\/no_23.png 370w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/03\/no_23-300x259.png 300w\" sizes=\"auto, (max-width: 370px) 100vw, 370px\" \/><\/p>\n<p style=\"text-align: center;\">\u300c\u30ec\u30b7\u30fc\u30c8\u30d7\u30ea\u30f3\u30bf\u3063\u3066<br \/>\n\u5b89\u3044\u306e\u304c\u3042\u308b\u3093\u3067\u3059\u306d\ud83d\ude32\u300d<\/p>\n<h1>\u3084\u308a\u305f\u3044\u3053\u3068<\/h1>\n<p>\u4eca\u56de\u958b\u767a\u3059\u308b\u5185\u5bb9\u306f\u304a\u304a\u307e\u304b\u306b\u6b21\u306e\uff14\u3064\u3067\u3059\u3002<\/p>\n<ul>\n<li>\u304a\u5ba2\u3055\u3093\u304c\u53d7\u4ed8\u756a\u53f7\u3092\u767a\u884c\u3067\u304d\u308b\uff08\u30ec\u30b7\u30fc\u30c8\u306b\u5370\u5237\uff09<\/li>\n<li>\u30b9\u30bf\u30c3\u30d5\u304c\u53d7\u4ed8\u30c7\u30fc\u30bf\u3092\u300c\u547c\u3073\u51fa\u3057\u300d\u300c\u5b8c\u4e86\u300d\u306b\u30b9\u30c6\u30fc\u30bf\u30b9\u5909\u66f4\u3067\u304d\u308b<\/li>\n<li>\u547c\u3073\u51fa\u3057\u8a2d\u5b9a\u3055\u308c\u305f\u53d7\u4ed8\u756a\u53f7\u3092\u30ea\u30b9\u30c8\u8868\u793a\u3057\u3001\u304a\u5ba2\u3055\u3093\u306b\u9806\u756a\u304c\u6765\u305f\u3053\u3068\u3092\u77e5\u3089\u305b\u308b<\/li>\n<\/ul>\n<p>\u3067\u306f\u3001\u5b9f\u969b\u306b\u3084\u3063\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u2757<\/p>\n<h1>\u30e2\u30c7\u30eb\uff06\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u3064\u304f\u308b<\/h1>\n<h2>\u53d7\u4ed8\u30bf\u30a4\u30d7\u30c7\u30fc\u30bf<\/h2>\n<p>\u307e\u305a\u306f\u53d7\u4ed8\u30bf\u30a4\u30d7\u3067\u3059\u3002<\/p>\n<pre><strong>php artisan make:model ReceptionType -m<\/strong><\/pre>\n<p>\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u305f\u3089\u3001\u30e2\u30c7\u30eb\u3092\u958b\u3044\u3066\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u30b7\u30c3\u30d7\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<p><strong><code>\/app\/ReceptionType.php<\/code><\/strong><\/p>\n<pre>&lt;?php\r\n\r\nnamespace App;\r\n\r\nuse Illuminate\\Database\\Eloquent\\Model;\r\n\r\nclass ReceptionType extends Model\r\n{\r\n    \/\/ Relationship\r\n<strong>    public function waits() { \/\/ \ud83d\udc48 \u5f85\u3063\u3066\u3044\u308b\u304a\u5ba2\u3055\u3093\uff08\u73fe\u5728 + \u6b21\u306e\u53d7\u4ed8\u30c7\u30fc\u30bf\uff09<\/strong>\r\n\r\n<strong>        return $this-&gt;hasMany('App\\Reception', 'type_id', 'id')<\/strong>\r\n<strong>            -&gt;whereIn('status', ['ready', 'preparation']);<\/strong>\r\n\r\n<strong>    }\r\n<\/strong>\r\n<strong>    public function readies() { \/\/ \ud83d\udc48 \u5bfe\u5fdc\u4e2d\u306e\u304a\u5ba2\u3055\u3093<\/strong>\r\n\r\n<strong>        return $this-&gt;hasMany('App\\Reception', 'type_id', 'id')<\/strong>\r\n<strong>            -&gt;whereIn('status', ['ready']);<\/strong>\r\n\r\n<strong>    }<\/strong>\r\n\r\n    private function getToday() {\r\n\r\n        return today()-&gt;format('Y-m-d');\r\n\r\n    }\r\n}<\/pre>\n<p>\u305d\u3057\u3066\u3001\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u5909\u66f4\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><strong><code>\/database\/migrations\/****_**_**_******_create_reception_types_table.php<\/code><\/strong><\/p>\n<pre>\/\/ \u7701\u7565\r\n\r\npublic function up()\r\n{\r\n    <strong>Schema::create('reception_types', function (Blueprint $table) {<\/strong>\r\n<strong>        $table-&gt;id();<\/strong>\r\n<strong>        $table-&gt;string('name')-&gt;comment('\u53d7\u4ed8\u30bf\u30a4\u30d7\u306e\u540d\u524d');<\/strong>\r\n<strong>        $table-&gt;timestamps();<\/strong>\r\n<strong>    });<\/strong>\r\n}\r\n\r\n\/\/ \u7701\u7565<\/pre>\n<h2>\u53d7\u4ed8\u30c7\u30fc\u30bf<\/h2>\n<p>\u6b21\u306b\u53d7\u4ed8\u30c7\u30fc\u30bf\u3067\u3059\u3002<br \/>\n\u3053\u3053\u3067\u53d7\u4ed8\u756a\u53f7\u3092\u7ba1\u7406\u3057\u307e\u3059\u3002<\/p>\n<pre><strong>php artisan make:model Reception -m<\/strong><\/pre>\n<p>\u7d9a\u3044\u3066\u3001\u5148\u306b\u30e2\u30c7\u30eb\u306b\u30bb\u30c3\u30c8\u3059\u308b<code>ReceptionCreating<\/code>\u30a4\u30d9\u30f3\u30c8\u3092\u4f5c\u308a\u307e\u3059\u3002<\/p>\n<pre><strong>php artisan make:event ReceptionCreating<\/strong><\/pre>\n<p>\u30a4\u30d9\u30f3\u30c8\u306e\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u305f\u3089\u4e2d\u8eab\u3092\u6b21\u306e\u3088\u3046\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><strong><code>\/app\/Events\/ReceptionCreating.php<\/code><\/strong><\/p>\n<pre>\/\/ \u7701\u7565\r\n\r\n<strong>public function __construct(Reception $reception)<\/strong>\r\n<strong>{<\/strong>\r\n<strong>    \/\/ \u4eca\u65e5\u306e\u6700\u5927\u53d7\u4ed8\u756a\u53f7\u3092\u53d6\u5f97<\/strong>\r\n<strong>    $received_on = today()-&gt;format('Y-m-d');<\/strong>\r\n<strong>    $max_reception_number = \\App\\Reception::where('received_on', $received_on) \/\/ \u4eca\u65e5\u306e\u65e5\u4ed8\u3067\u7d5e\u308a\u8fbc\u307f<\/strong>\r\n<strong>        -&gt;where('type_id', $reception-&gt;type_id) \/\/ \u540c\u3058\u53d7\u4ed8\u30bf\u30a4\u30d7\u3067\u7d5e\u308a\u8fbc\u307f<\/strong>\r\n<strong>        -&gt;max('reception_number');<\/strong>\r\n<strong>    $reception-&gt;reception_number = intval($max_reception_number) + 1; \/\/ \u65b0\u3057\u3044\u53d7\u4ed8\u756a\u53f7\u3092\u30bb\u30c3\u30c8<\/strong>\r\n<strong>    $reception-&gt;received_on = $received_on;<\/strong>\r\n<strong>}<\/strong>\r\n\r\n\/\/ \u7701\u7565<\/pre>\n<p>\u3053\u306e\u4e2d\u3067\u306f\u3001<strong><code>receptions<\/code>\u30c6\u30fc\u30d6\u30eb\u306b\u65b0\u898f\u30c7\u30fc\u30bf\u8ffd\u52a0\u3059\u308b\u3068\u304d\u3001\u81ea\u52d5\u3067\u53d7\u4ed8\u756a\u53f7\u3068\u4eca\u65e5\u306e\u65e5\u4ed8\u3092\u30bb\u30c3\u30c8\u3057\u307e\u3059\u3002<\/strong><\/p>\n<p>\u305d\u3057\u3066\u3001\u30e2\u30c7\u30eb\u3092\u958b\u3044\u3066\u30a4\u30d9\u30f3\u30c8\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<p><strong><code>\/app\/Reception.php<\/code><\/strong><\/p>\n<pre>&lt;?php\r\n\r\nnamespace App;\r\n\r\nuse App\\Events\\ReceptionCreating;\r\nuse Illuminate\\Database\\Eloquent\\Model;\r\n\r\nclass Reception extends Model\r\n{\r\n    <strong>protected $dispatchesEvents = [<\/strong>\r\n<strong>        'creating' =&gt; ReceptionCreating::class<\/strong>\r\n<strong>    ];<\/strong>\r\n}<\/pre>\n<p>\u307e\u305f\u3001\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5909\u66f4\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><code><strong>\/database\/migrations\/****_**_**_******_create_receptions_table.php<\/strong><\/code><\/p>\n<pre>\/\/ \u7701\u7565\r\n\r\n<strong>public function up()<\/strong>\r\n<strong>{<\/strong>\r\n<strong>    Schema::create('receptions', function (Blueprint $table) {<\/strong>\r\n<strong>        $table-&gt;id();<\/strong>\r\n<strong>        $table-&gt;unsignedBigInteger('type_id')-&gt;comment('reception_types.id');<\/strong>\r\n<strong>        $table-&gt;integer('reception_number')-&gt;comment('\u53d7\u4ed8\u756a\u53f7');<\/strong>\r\n<strong>        $table-&gt;string('status')-&gt;default('preparation')-&gt;comment('\u72b6\u614b'); \/\/ preparation: \u6e96\u5099\u4e2d, ready: \u6e96\u5099\u6e08\u307f, complete: \u5b8c\u4e86<\/strong>\r\n<strong>        $table-&gt;date('received_on')-&gt;comment('\u53d7\u4ed8\u3057\u305f\u65e5\u4ed8');<\/strong>\r\n<strong>        $table-&gt;timestamps();<\/strong>\r\n\r\n<strong>        $table-&gt;foreign('type_id')-&gt;references('id')-&gt;on('reception_types');<\/strong>\r\n<strong>    });<\/strong>\r\n<strong>}<\/strong>\r\n\r\n\/\/ \u7701\u7565<\/pre>\n<h1>\u521d\u671f\uff08\u30c6\u30b9\u30c8\uff09\u30c7\u30fc\u30bf\u3092\u3064\u304f\u308b<\/h1>\n<p>\u5148\u307b\u3069\u3064\u304f\u3063\u305f\u30c6\u30fc\u30d6\u30eb<code>reception_types<\/code>\u306b\u4eca\u56de\u306f\u4ee5\u4e0b\uff14\u3064\u306e\u53d7\u4ed8\u30bf\u30a4\u30d7\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u65b0\u898f\u53e3\u5ea7\u958b\u8a2d<\/li>\n<li>\u632f\u308a\u8fbc\u307f\u30fb\u9810\u3051\u5165\u308c\u30fb\u5f15\u304d\u51fa\u3057<\/li>\n<li>\u878d\u8cc7\u30fb\u30ed\u30fc\u30f3<\/li>\n<li>\u305d\u306e\u4ed6<\/li>\n<\/ul>\n<p>\u3067\u306f\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>php artisan make:seed ReceptionTypesSeeder<\/strong><\/pre>\n<p><strong><code>\/database\/seeds\/ReceptionTypesSeeder.php<\/code><\/strong><\/p>\n<pre>&lt;?php\r\n\r\nuse Illuminate\\Database\\Seeder;\r\n\r\nclass ReceptionTypesSeeder extends Seeder\r\n{\r\n    \/**\r\n     * Run the database seeds.\r\n     *\r\n     * @return void\r\n     *\/\r\n    public function run()\r\n    {\r\n        <strong>$type_names = [<\/strong>\r\n<strong>            '\u65b0\u898f\u53e3\u5ea7\u958b\u8a2d',<\/strong>\r\n<strong>            '\u632f\u308a\u8fbc\u307f\u30fb\u9810\u3051\u5165\u308c\u30fb\u5f15\u304d\u51fa\u3057',<\/strong>\r\n<strong>            '\u878d\u8cc7\u30fb\u30ed\u30fc\u30f3',<\/strong>\r\n<strong>            '\u305d\u306e\u4ed6'<\/strong>\r\n<strong>        ];<\/strong>\r\n\r\n<strong>        foreach($type_names as $type_name) {<\/strong>\r\n\r\n<strong>            $reception_type = new \\App\\ReceptionType();<\/strong>\r\n<strong>            $reception_type-&gt;name = $type_name;<\/strong>\r\n<strong>            $reception_type-&gt;save();<\/strong>\r\n\r\n<strong>        }<\/strong>\r\n    }\r\n}<\/pre>\n<p>\u6b21\u306b<code>ReceptionTypesSeeder<\/code>\u3092\u767b\u9332\u3057\u307e\u3059\u3002<\/p>\n<p><strong><code>\/database\/seeds\/DatabaseSeeder.php<\/code><\/strong><\/p>\n<pre>&lt;?php\r\n\r\nuse Illuminate\\Database\\Seeder;\r\n\r\nclass DatabaseSeeder extends Seeder\r\n{\r\n    \/**\r\n     * Seed the application's database.\r\n     *\r\n     * @return void\r\n     *\/\r\n    public function run()\r\n    {\r\n         \/\/$this-&gt;call(UsersTableSeeder::class);\r\n         <strong>$this-&gt;call(ReceptionTypesSeeder::class); \/\/ \ud83d\udc48 \u8ffd\u52a0<\/strong>\r\n    }\r\n}<\/pre>\n<p>\u3067\u306f\u3001\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u5b9f\u884c\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre><strong>php artisan migrate:fresh --seed<\/strong><\/pre>\n<p><code>reception_types<\/code>\u30c6\u30fc\u30d6\u30eb\u306f\u3053\u3046\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-7170\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/laravel_wait_system_1.png\" alt=\"\" width=\"571\" height=\"344\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/laravel_wait_system_1.png 571w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/laravel_wait_system_1-300x181.png 300w\" sizes=\"auto, (max-width: 571px) 100vw, 571px\" \/><\/p>\n<h1>\u30eb\u30fc\u30c8\u3092\u3064\u304f\u308b<\/h1>\n<p>\u3067\u306f\u3001\u6b21\u306b\u30eb\u30fc\u30c8\u3067\u3059\u3002<\/p>\n<p><strong><code>\/routes\/web.php<\/code><\/strong><\/p>\n<pre>\/\/ \u30d6\u30e9\u30a6\u30b6\u5074 \u30fb\u30fb\u30fb \u2460\r\n<strong>Route::get('reception\/number_tag', 'ReceptionController@number_tag');<\/strong>\r\n<strong>Route::get('reception\/display', 'ReceptionController@display');<\/strong>\r\n<strong>Route::get('reception\/manage', 'ReceptionController@manage');<\/strong>\r\n\r\n\/\/ Ajax \u30fb\u30fb\u30fb \u2461\r\n<strong>Route::post('ajax\/reception', 'Ajax\\ReceptionController@store');<\/strong>\r\n<strong>Route::put('ajax\/reception\/{reception}', 'Ajax\\ReceptionController@update');<\/strong>\r\n<strong>Route::get('ajax\/reception_type', 'Ajax\\receptionTypeController@index');<\/strong><\/pre>\n<p>\u30eb\u30fc\u30c8\u306e\u4e2d\u3067\u306f\u305d\u308c\u305e\u308c\u6b21\u306e\u5f79\u5272\u3092\u3082\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><strong>\u2460\u30d6\u30e9\u30a6\u30b6\u5074<\/strong><\/p>\n<ul>\n<li>reception\/number_tag: \u304a\u5ba2\u3055\u3093\u304c\u53d7\u4ed8\u756a\u53f7\u3092\u767a\u884c\u3059\u308b\u30da\u30fc\u30b8<\/li>\n<li>reception\/display: \u9806\u756a\u304c\u56de\u3063\u3066\u304d\u305f\u53d7\u4ed8\u756a\u53f7\u3092\u8868\u793a\u3059\u308b\u30da\u30fc\u30b8<\/li>\n<li>reception\/manage: \u30b9\u30bf\u30c3\u30d5\u304c\u53d7\u4ed8\u30c7\u30fc\u30bf\u3092\u7ba1\u7406\u3059\u308b\u30da\u30fc\u30b8<\/li>\n<\/ul>\n<p><strong>\u2461Ajax\u5074<\/strong><\/p>\n<ul>\n<li>ajax\/reception: \u65b0\u898f\u53d7\u4ed8\u30c7\u30fc\u30bf\u3092\u8ffd\u52a0\u3059\u308b<\/li>\n<li>ajax\/reception\/{reception}: \u53d7\u4ed8\u30c7\u30fc\u30bf\u3092\u66f4\u65b0\u3059\u308b\uff08\u30b9\u30c6\u30fc\u30bf\u30b9\u5909\u66f4\uff09<\/li>\n<li>ajax\/reception_type: \u53d7\u4ed8\u30bf\u30a4\u30d7\uff08\u3068\u95a2\u9023\u30c7\u30fc\u30bf\uff09\u3092\u53d6\u5f97\u3059\u308b<\/li>\n<\/ul>\n<h1>\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\u3064\u304f\u308b<\/h1>\n<p>\u305d\u3057\u3066\u3001\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3067\u3059\u304c\u5168\u90e8\u3067\uff13\u3064\u4f5c\u308a\u307e\u3059\u3002<\/p>\n<h2>\u30d6\u30e9\u30a6\u30b6\u5074\u306e\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc<\/h2>\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:controller ReceptionController<\/strong><\/pre>\n<p>\u4e2d\u8eab\u306f\u3053\u3046\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre>&lt;?php\r\n\r\nnamespace App\\Http\\Controllers;\r\n\r\nuse Illuminate\\Http\\Request;\r\n\r\nclass ReceptionController extends Controller\r\n{\r\n    \/\/ \ud83d\udc47 \u8ffd\u52a0\r\n    <strong>public function number_tag() {<\/strong>\r\n\r\n<strong>        return view('reception.number_tag');<\/strong>\r\n\r\n<strong>    }<\/strong>\r\n\r\n<strong>    public function display() {<\/strong>\r\n\r\n<strong>        return view('reception.display');<\/strong>\r\n\r\n<strong>    }<\/strong>\r\n\r\n<strong>    public function manage() {<\/strong>\r\n\r\n<strong>        return view('reception.manage');<\/strong>\r\n\r\n<strong>    }<\/strong>\r\n}<\/pre>\n<h2>Ajax\u5074\u306e\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc<\/h2>\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:controller Ajax\\\\ReceptionController<\/strong><\/pre>\n<p>\u3053\u306e\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u306f\u3001<code>receptions<\/code>\u30c6\u30fc\u30d6\u30eb\u306b\u30c7\u30fc\u30bf\u3092\u8ffd\u52a0\uff0f\u66f4\u65b0\u3059\u308b\u305f\u3081\u306b\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<p>\u4e2d\u8eab\u306f\u3053\u3046\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><strong><code>\/app\/Http\/Controllers\/Ajax\/ReceptionController.php<\/code><\/strong><\/p>\n<pre>&lt;?php\r\n\r\nnamespace App\\Http\\Controllers\\Ajax;\r\n\r\nuse App\\Http\\Controllers\\Controller;\r\nuse Illuminate\\Http\\Request;\r\n\r\nclass ReceptionController extends Controller\r\n{\r\n    <strong>public function store(Request $request) { \/\/ \ud83d\udc48 \u65b0\u898f\u8ffd\u52a0<\/strong>\r\n\r\n<strong>        \/\/ \u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3<\/strong>\r\n<strong>        $request-&gt;validate([<\/strong>\r\n<strong>            'type_id' =&gt; 'required|integer|exists:reception_types,id'<\/strong>\r\n<strong>        ]);<\/strong>\r\n\r\n<strong>        \/\/ \u65b0\u898f\u5f85\u53d7\u30c7\u30fc\u30bf\u3092\u8ffd\u52a0<\/strong>\r\n<strong>        $reception = new \\App\\Reception();<\/strong>\r\n<strong>        $reception-&gt;type_id = $request-&gt;type_id;<\/strong>\r\n<strong>        $result = $reception-&gt;save();<\/strong>\r\n<strong>        return ['result' =&gt; $result];<\/strong>\r\n\r\n<strong>    }<\/strong>\r\n\r\n<strong>    public function update(Request $request) {{ \/\/ \ud83d\udc48 \u66f4\u65b0<\/strong>\r\n\r\n<strong>        \/\/ \u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3<\/strong>\r\n<strong>        $request-&gt;validate([<\/strong>\r\n<strong>            'status' =&gt; 'in:ready,complete'<\/strong>\r\n<strong>        ]);<\/strong>\r\n\r\n<strong>        $reception = \\App\\Reception::find($request-&gt;id);<\/strong>\r\n<strong>        $reception-&gt;status = $request-&gt;status;<\/strong>\r\n<strong>        $result = $reception-&gt;save();<\/strong>\r\n<strong>        return ['result' =&gt; $result];<\/strong>\r\n\r\n<strong>    }<\/strong>\r\n}<\/pre>\n<p>\u306a\u304a\u3001\u305d\u308c\u305e\u308c\u306e\u30e1\u30bd\u30c3\u30c9\u304c\u5b9f\u884c\u3055\u308c\u308b\u306e\u306f\u6b21\u306e\u5834\u5408\u3067\u3059\u3002<\/p>\n<ul>\n<li>store: \u304a\u5ba2\u3055\u3093\u304c\u53d7\u4ed8\u756a\u53f7\u3092\u767a\u884c\u3057\u305f<\/li>\n<li>update: \u30b9\u30bf\u30c3\u30d5\u304c\u5f85\u3063\u3066\u3044\u308b\u304a\u5ba2\u3055\u3093\u3092\u547c\u3073\u51fa\u3057\u305f<\/li>\n<li>update: \u76f8\u8ac7\u304c\u5b8c\u4e86\u3057\u305f<\/li>\n<\/ul>\n<p>\u305d\u3057\u3066\u3001\u53d7\u4ed8\u30bf\u30a4\u30d7\u3092<code>Ajax<\/code>\u3067\u53d6\u5f97\u3059\u308b\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3082\u3064\u304f\u308a\u307e\u3059\u3002<br \/>\n\u540c\u3058\u304f\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>php artisan make:controller Ajax\\\\ReceptionTypeController<\/strong><\/pre>\n<p>\u4e2d\u8eab\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5909\u66f4\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><strong><code>\/app\/Http\/Controllers\/Ajax\/ReceptionTypeController.php<\/code><\/strong><\/p>\n<pre>&lt;?php\r\n\r\nnamespace App\\Http\\Controllers\\Ajax;\r\n\r\nuse App\\Http\\Controllers\\Controller;\r\nuse Illuminate\\Http\\Request;\r\n\r\nclass ReceptionTypeController extends Controller\r\n{\r\n    <strong>public function index() {<\/strong>\r\n\r\n<strong>        return \\App\\ReceptionType::with('waits', 'readies')<\/strong>\r\n<strong>            -&gt;withCount('waits')<\/strong>\r\n<strong>            -&gt;get();<\/strong>\r\n\r\n<strong>    }<\/strong>\r\n}<\/pre>\n<p>\u3053\u306e\u4e2d\u3067\u306f\u3001\u53d7\u4ed8\u30bf\u30a4\u30d7\u3092\u53d6\u5f97\u3059\u308b\u306e\u3067\u3059\u304c\u540c\u6642\u306b\u4ee5\u4e0b\u306e\u30c7\u30fc\u30bf\u3082\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u30b7\u30c3\u30d7\u3092\u901a\u3057\u3066\u53d6\u5f97\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<ul>\n<li>waits: \u5f85\u3063\u3066\u3044\u308b\u304a\u5ba2\u3055\u3093\uff06\u305d\u306e\u4ef6\u6570<\/li>\n<li>readies: \u5bfe\u5fdc\u4e2d\u306e\u304a\u5ba2\u3055\u3093<\/li>\n<\/ul>\n<h1>\u30d3\u30e5\u30fc\u3092\u3064\u304f\u308b<\/h1>\n<p>\u3067\u306f\u3001\u30d3\u30e5\u30fc\u3092\u3064\u304f\u3063\u3066\u3044\u304d\u307e\u3059\u3002<br \/>\n\u5185\u5bb9\u306f\u6b21\u306e\u3068\u304a\u308a\u3067\u3059\u3002<\/p>\n<ul>\n<li>\u304a\u5ba2\u3055\u3093\u304c\u53d7\u4ed8\u756a\u53f7\u3092\u767a\u884c\u3059\u308b\u30da\u30fc\u30b8<\/li>\n<li>\u7ba1\u7406\u8005\u304c\u5f85\u53d7\u3092\u64cd\u4f5c\u3059\u308b\u30da\u30fc\u30b8<\/li>\n<li>\u9806\u756a\u304c\u6765\u305f\u3053\u3068\u304c\u5206\u304b\u308b\u547c\u3073\u51fa\u3057\u30da\u30fc\u30b8<\/li>\n<\/ul>\n<p>\u3067\u306f\u3001\u3072\u3068\u3064\u305a\u3064\u4f5c\u3063\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<h2>\u304a\u5ba2\u3055\u3093\u304c\u53d7\u4ed8\u756a\u53f7\u3092\u767a\u884c\u3059\u308b\u30da\u30fc\u30b8<\/h2>\n<p><strong><code>\/resources\/views\/reception\/number_tag.blade.php<\/code><\/strong><\/p>\n<pre>&lt;html&gt;\r\n&lt;head&gt;\r\n    &lt;link href=\"https:\/\/stackpath.bootstrapcdn.com\/bootstrap\/4.4.1\/css\/bootstrap.min.css\" rel=\"stylesheet\"&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n    &lt;div id=\"app\" class=\"p-4\"&gt;\r\n        &lt;h1 class=\"mb-3\"&gt;\u7a93\u53e3\u306e\u53d7\u4ed8\u756a\u53f7\u30b7\u30b9\u30c6\u30e0\u30fb\u30b5\u30f3\u30d7\u30eb&lt;\/h1&gt;\r\n        &lt;div class=\"bg-light p-3 mb-5\"&gt;\r\n            \u3054\u7528\u4ef6\u3092\u9078\u3093\u3067\u304f\u3060\u3055\u3044\u3002\r\n        &lt;\/div&gt;\r\n        &lt;div class=\"row\"&gt;\r\n            <strong>&lt;!-- \u53d7\u4ed8\u30bf\u30a4\u30d7\u3054\u3068\u306e\u30dc\u30bf\u30f3\u3092\u3064\u304f\u308b \u30fb\u30fb\u30fb \u2460 --&gt;<\/strong>\r\n<strong>            &lt;div class=\"col-md-6\" v-for=\"t in receptionTypes\"&gt;<\/strong>\r\n<strong>                &lt;button<\/strong>\r\n<strong>                    type=\"button\"<\/strong>\r\n<strong>                    class=\"btn btn-info btn-lg btn-block mb-5 text-bold\"<\/strong>\r\n<strong>                    style=\"height:100px;\"<\/strong>\r\n<strong>                    :disabled=\"submitting\"<\/strong>\r\n<strong>                    @click=\"issueNumberTag(t.id)\"&gt;<\/strong>\r\n<strong>                    &lt;span v-text=\"t.name\"&gt;&lt;\/span&gt;<\/strong>\r\n<strong>                    \uff08&lt;span v-text=\"t.waits_count\"&gt;&lt;\/span&gt;\u4eba\u5f85\u3061\uff09<\/strong>\r\n<strong>                &lt;\/button&gt;<\/strong>\r\n<strong>            &lt;\/div&gt;<\/strong>\r\n<strong>            &lt;div class=\"col-md-12 text-center\" v-if=\"submitting\"&gt;<\/strong>\r\n<strong>                &lt;h1 class=\"text-danger text-bold\"&gt;\u53d7\u4ed8\u756a\u53f7\u3092\u304a\u53d6\u308a\u304f\u3060\u3055\u3044\u3002&lt;\/h1&gt;<\/strong>\r\n<strong>            &lt;\/div&gt;<\/strong>\r\n        &lt;\/div&gt;\r\n    &lt;\/div&gt;\r\n    &lt;script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/vue\/2.6.11\/vue.min.js\"&gt;&lt;\/script&gt;\r\n    &lt;script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/axios\/0.19.2\/axios.min.js\"&gt;&lt;\/script&gt;\r\n    &lt;script&gt;\r\n\r\n        new Vue({\r\n            el: '#app',\r\n            data: {\r\n                receptionTypes: [],\r\n                submitting: false\r\n            },\r\n            methods: {\r\n                getTypes() {\r\n\r\n                    \/\/ reception_types\u306e\u30c7\u30fc\u30bf\u53d6\u5f97\r\n                    axios.get('\/ajax\/reception_type')\r\n                        .then(response =&gt; {\r\n\r\n                            this.receptionTypes = response.data;\r\n\r\n                        });\r\n\r\n                },\r\n                issueNumberTag(receptionTypeId) {\r\n\r\n                    this.submitting = true;\r\n\r\n                    <strong>\/\/ \u9078\u629e\u3055\u308c\u305f\u30dc\u30bf\u30f3\u306e\u53d7\u4ed8\u30bf\u30a4\u30d7ID\u3092\u9001\u4fe1\u3057\u3066receptions\u30c7\u30fc\u30bf\u3092\u8ffd\u52a0 \u30fb\u30fb\u30fb \u2461<\/strong>\r\n<strong>                    const url = '\/ajax\/reception';<\/strong>\r\n<strong>                    const params = {<\/strong>\r\n<strong>                        type_id: receptionTypeId<\/strong>\r\n<strong>                    };<\/strong>\r\n<strong>                    axios.post(url, params)<\/strong>\r\n<strong>                        .then(response =&gt; {<\/strong>\r\n\r\n<strong>                            if(response.data.result === true) {<\/strong>\r\n\r\n<strong>                                console.log('\u767b\u9332\u6210\u529f\uff01');<\/strong>\r\n\r\n<strong>                            }<\/strong>\r\n\r\n<strong>                        })<\/strong>\r\n<strong>                        .catch(error =&gt; { \/* \u30a8\u30e9\u30fc\u51e6\u7406 *\/ })<\/strong>\r\n<strong>                        .then(() =&gt; {<\/strong>\r\n\r\n<strong>                            \/\/ \u53d7\u4ed8\u756a\u53f7\u3092\u5370\u5237\u3059\u308b\u6642\u9593\u3068\u3057\u30665\u79d2\u5f85\u6a5f\u3059\u308b<\/strong>\r\n<strong>                            setTimeout(() =&gt; {<\/strong>\r\n\r\n<strong>                                this.submitting = false;<\/strong>\r\n<strong>                                this.getTypes();<\/strong>\r\n\r\n<strong>                            }, 5000);<\/strong>\r\n\r\n<strong>                        });<\/strong>\r\n\r\n                }\r\n            },\r\n            mounted() {\r\n\r\n                this.getTypes();\r\n                setInterval(() =&gt; { \/\/ 3\u79d2\u3054\u3068\u306b\u53d7\u4ed8\u30c7\u30fc\u30bf\u3092\u66f4\u65b0\u3059\u308b\r\n\r\n                    this.getTypes();\r\n\r\n                }, 3000);\r\n\r\n            }\r\n        });\r\n\r\n    &lt;\/script&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n<p>\u3053\u306e\u4e2d\u3067\u91cd\u8981\u306a\u306e\u306f\u6b21\u306e\u3068\u304a\u308a\u3067\u3059\u3002<\/p>\n<p><strong>\u2460\u53d7\u4ed8\u30bf\u30a4\u30d7\u3054\u3068\u306e\u30dc\u30bf\u30f3\u3092\u3064\u304f\u308b<\/strong><\/p>\n<p>\u5168\u3066\u306e\u53d7\u4ed8\u30bf\u30a4\u30d7\u306b\u5bfe\u5fdc\u3059\u308b\u30dc\u30bf\u30f3\uff08\u4eca\u56de\u306f\uff14\u3064\uff09\u3092\u30eb\u30fc\u30d7\u3067\u4f5c\u6210\u3059\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u304c\u3001\u30eb\u30fc\u30d7\u306e\u5143\u306b\u306a\u308b<code>receptionTypes<\/code>\u306f<code>mounted()<\/code>\u306e\u4e2d\u3067Ajax\u3092\u901a\u3057\u3066\u53d6\u5f97\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><strong>\u2461\u9078\u629e\u3055\u308c\u305f\u30dc\u30bf\u30f3\u306e\u53d7\u4ed8\u30bf\u30a4\u30d7ID\u3092\u9001\u4fe1\u3057\u3066\u300creceptions\u300d\u30c7\u30fc\u30bf\u3092\u8ffd\u52a0<\/strong><\/p>\n<p>\u3053\u3053\u306f\u5404\u30dc\u30bf\u30f3\u304c\u30af\u30ea\u30c3\u30af\u3055\u308c\u305f\u3068\u304d\u306b\u5b9f\u884c\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u9001\u4fe1\u3055\u308c\u308b\u30c7\u30fc\u30bf\u306f\u3001\u30af\u30ea\u30c3\u30af\u3055\u308c\u305f\u53d7\u4ed8\u30bf\u30a4\u30d7\u306eID\u3067\u3001\u3053\u306e\u30c7\u30fc\u30bf\u3092\u4f7f\u3063\u3066<code>Ajax\\ReceptionController<\/code>\u3067\u30c7\u30fc\u30bf\u767b\u9332\u3059\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002\uff08\u3064\u307e\u308a\u3001\u65b0\u3057\u3044\u53d7\u4ed8\u3092\u3059\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\uff09<\/p>\n<p>\u8868\u793a\u3059\u308b\u3068\u3053\u3046\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-7177\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/laravel_wait_system_2.png\" alt=\"\" width=\"640\" height=\"379\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/laravel_wait_system_2.png 640w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/laravel_wait_system_2-300x178.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<h2>\u7ba1\u7406\u8005\u304c\u5f85\u53d7\u3092\u64cd\u4f5c\u3059\u308b\u30da\u30fc\u30b8<\/h2>\n<p>\u6b21\u306b\u3001\u304a\u5ba2\u3055\u3093\u306e\u53d7\u4ed8\u30c7\u30fc\u30bf\u3092\u5909\u66f4\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b\u30da\u30fc\u30b8\u3067\u3059\u3002<\/p>\n<p><strong><code>\/resources\/views\/reception\/manage.blade.php<\/code><\/strong><\/p>\n<pre>&lt;html&gt;\r\n&lt;head&gt;\r\n    &lt;link href=\"https:\/\/stackpath.bootstrapcdn.com\/bootstrap\/4.4.1\/css\/bootstrap.min.css\" rel=\"stylesheet\"&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n    &lt;div id=\"app\" class=\"p-4\"&gt;\r\n        &lt;h1 class=\"mb-3\"&gt;\u53d7\u4ed8\u4e2d\u306e\u30c7\u30fc\u30bf&lt;\/h1&gt;\r\n        &lt;div class=\"bg-light p-3 mb-4\"&gt;\r\n            &lt;small&gt;\r\n                \u547c\u3073\u51fa\u3059\uff1a \u5f85\u6a5f\u4e2d\u306e\u304a\u5ba2\u3055\u3093\u3092\u547c\u3073\u51fa\u3059\uff08status: ready\u3078\u5909\u66f4\uff09&lt;br&gt;\r\n                \u5b8c\u4e86\uff1a \u5bfe\u5fdc\u3092\u7d42\u4e86\uff08status: complete\u3078\u5909\u66f4\uff09\r\n            &lt;\/small&gt;\r\n        &lt;\/div&gt;\r\n        &lt;table class=\"table table-striped\"&gt;\r\n            &lt;thead class=\"bg-info text-white\"&gt;\r\n                &lt;tr&gt;\r\n                    &lt;th&gt;\u53d7\u4ed8\u30bf\u30a4\u30d7&lt;\/th&gt;\r\n                    &lt;th&gt;\u53d7\u4ed8\u756a\u53f7&lt;\/th&gt;\r\n                &lt;\/tr&gt;\r\n            &lt;\/thead&gt;\r\n            &lt;tbody&gt;\r\n                &lt;tr v-for=\"t in receptionTypes\"&gt;\r\n                    &lt;td&gt;\r\n                        &lt;span v-text=\"t.name\"&gt;&lt;\/span&gt;\r\n                        \uff08&lt;span v-text=\"t.waits_count\"&gt;&lt;\/span&gt;\u4eba\u5f85\u3061\uff09\r\n                    &lt;\/td&gt;\r\n                    &lt;td&gt;\r\n                        &lt;div style=\"max-height:300px;overflow-x:hidden;overflow-y:auto;\"\r\n                             class=\"border bg-light border-1 px-3 py-2\"\r\n                             v-if=\"t.waits.length\"&gt;\r\n                            &lt;div class=\"row py-2\" v-for=\"w in t.waits\"&gt;\r\n                                &lt;div class=\"col-md-3 pl-3\"&gt;\r\n                                    &lt;h4 v-text=\"w.reception_number\"&gt;&lt;\/h4&gt;\r\n                                &lt;\/div&gt;\r\n                                <strong>&lt;!-- \ud83d\udc47 \u64cd\u4f5c\u30dc\u30bf\u30f3 --&gt;<\/strong>\r\n<strong>                                &lt;div class=\"col-md-9 text-right\"&gt;<\/strong>\r\n<strong>                                    &lt;button<\/strong>\r\n<strong>                                        type=\"button\"<\/strong>\r\n<strong>                                        class=\"btn btn-sm btn-link mr-4\"<\/strong>\r\n<strong>                                        @click=\"updateStatusTo('complete', w.id)\"&gt;\u524a\u9664\u3059\u308b&lt;\/button&gt;<\/strong>\r\n<strong>                                    &lt;button<\/strong>\r\n<strong>                                        type=\"button\"<\/strong>\r\n<strong>                                        class=\"btn btn-info\"<\/strong>\r\n<strong>                                        @click=\"updateStatusTo('ready', w.id)\"<\/strong>\r\n<strong>                                        v-if=\"w.status=='preparation'\"&gt;\u547c\u3073\u51fa\u3059&lt;\/button&gt;<\/strong>\r\n<strong>                                    &lt;button<\/strong>\r\n<strong>                                        type=\"button\"<\/strong>\r\n<strong>                                        class=\"btn btn-primary\"<\/strong>\r\n<strong>                                        @click=\"updateStatusTo('complete', w.id)\"<\/strong>\r\n<strong>                                        v-if=\"w.status=='ready'\"&gt;\u5b8c\u4e86\u3059\u308b&lt;\/button&gt;<\/strong>\r\n<strong>                                &lt;\/div&gt;<\/strong>\r\n                            &lt;\/div&gt;\r\n                        &lt;\/div&gt;\r\n                    &lt;\/td&gt;\r\n                &lt;\/tr&gt;\r\n            &lt;\/tbody&gt;\r\n        &lt;\/table&gt;\r\n    &lt;\/div&gt;\r\n    &lt;script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/vue\/2.6.11\/vue.min.js\"&gt;&lt;\/script&gt;\r\n    &lt;script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/axios\/0.19.2\/axios.min.js\"&gt;&lt;\/script&gt;\r\n    &lt;script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/lodash.js\/4.17.15\/lodash.min.js\"&gt;&lt;\/script&gt;\r\n    &lt;script&gt;\r\n\r\n        new Vue({\r\n            el: '#app',\r\n            data: {\r\n                receptionTypes: []\r\n            },\r\n            methods: {\r\n                getTypes() {\r\n\r\n                    \/\/ reception_types\u306e\u30c7\u30fc\u30bf\u53d6\u5f97\r\n                    axios.get('\/ajax\/reception_type')\r\n                        .then(response =&gt; {\r\n\r\n                            this.receptionTypes = response.data;\r\n\r\n                        });\r\n\r\n                },\r\n                updateStatusTo(status, receptionId) {\r\n\r\n                    if(confirm('\u30b9\u30c6\u30fc\u30bf\u30b9\u3092\u5909\u66f4\u3057\u307e\u3059\u3002\u3088\u308d\u3057\u3044\u3067\u3059\u304b\uff1f')) {\r\n\r\n                        <strong>\/\/ \ud83d\udc47 \u53d7\u4ed8\u30c7\u30fc\u30bf\u3092\u5909\u66f4\u3059\u308b<\/strong>\r\n<strong>                        const url = '\/ajax\/reception\/'+ receptionId;<\/strong>\r\n<strong>                        const params = {<\/strong>\r\n<strong>                            id: receptionId,<\/strong>\r\n<strong>                            status: status<\/strong>\r\n<strong>                        };<\/strong>\r\n<strong>                        axios.put(url, params)<\/strong>\r\n<strong>                            .then(response =&gt; {<\/strong>\r\n\r\n<strong>                                if(response.data.result === true) {<\/strong>\r\n\r\n<strong>                                    console.log('\u5909\u66f4\u5b8c\u4e86\uff01');<\/strong>\r\n<strong>                                    this.getTypes();<\/strong>\r\n\r\n<strong>                                }<\/strong>\r\n\r\n<strong>                            });<\/strong>\r\n\r\n                    }\r\n\r\n                }\r\n            },\r\n            mounted() {\r\n\r\n                this.getTypes();\r\n                setInterval(() =&gt; { \/\/ 3\u79d2\u3054\u3068\u306b\u53d7\u4ed8\u30c7\u30fc\u30bf\u3092\u66f4\u65b0\u3059\u308b\r\n\r\n                    this.getTypes();\r\n\r\n                }, 3000);\r\n\r\n            }\r\n        });\r\n\r\n    &lt;\/script&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n<p>\u8868\u793a\u4f8b\u306f\u3053\u3046\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-7175\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/laravel_wait_system_3.png\" alt=\"\" width=\"640\" height=\"379\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/laravel_wait_system_3.png 640w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/laravel_wait_system_3-300x178.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<h2>\u9806\u756a\u304c\u6765\u305f\u3053\u3068\u304c\u5206\u304b\u308b\u547c\u3073\u51fa\u3057\u30da\u30fc\u30b8<\/h2>\n<p>\u6700\u5f8c\u306b\u304a\u5ba2\u3055\u3093\u304c\u81ea\u5206\u306e\u9806\u756a\u3092\u78ba\u8a8d\u3059\u308b\u300c\u547c\u3073\u51fa\u3057\u300d\u30da\u30fc\u30b8\u3067\u3059\u3002<\/p>\n<p><strong>\/resources\/views\/reception\/display.blade.php<\/strong><\/p>\n<pre>&lt;html&gt;\r\n&lt;head&gt;\r\n    &lt;link href=\"https:\/\/stackpath.bootstrapcdn.com\/bootstrap\/4.4.1\/css\/bootstrap.min.css\" rel=\"stylesheet\"&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n    &lt;div id=\"app\" class=\"p-4\"&gt;\r\n        &lt;h1 class=\"mb-3\"&gt;\u304a\u5f85\u305f\u305b\u3057\u307e\u3057\u305f&lt;\/h1&gt;\r\n        &lt;table class=\"table table-striped\"&gt;\r\n            &lt;thead class=\"bg-info text-white\"&gt;\r\n                &lt;tr&gt;\r\n                    &lt;th&gt;\u53d7\u4ed8\u30bf\u30a4\u30d7&lt;\/th&gt;\r\n                    &lt;th&gt;\r\n                        \u53d7\u4ed8\u756a\u53f7\r\n                    &lt;\/th&gt;\r\n                &lt;\/tr&gt;\r\n            &lt;\/thead&gt;\r\n            &lt;tbody&gt;\r\n                &lt;tr v-for=\"t in receptionTypes\"&gt;\r\n                    &lt;td v-text=\"t.name\"&gt;&lt;\/td&gt;\r\n                    &lt;td&gt;\r\n                        &lt;div v-if=\"t.readies.length\"&gt;\r\n                            &lt;h4 v-text=\"getReceptionNumbers(t.readies).join(',\u3000')\"&gt;&lt;\/h4&gt;\r\n                        &lt;\/div&gt;\r\n                    &lt;\/td&gt;\r\n                &lt;\/tr&gt;\r\n            &lt;\/tbody&gt;\r\n        &lt;\/table&gt;\r\n    &lt;\/div&gt;\r\n    &lt;script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/vue\/2.6.11\/vue.min.js\"&gt;&lt;\/script&gt;\r\n    &lt;script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/axios\/0.19.2\/axios.min.js\"&gt;&lt;\/script&gt;\r\n    &lt;script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/lodash.js\/4.17.15\/lodash.min.js\"&gt;&lt;\/script&gt;\r\n    &lt;script&gt;\r\n\r\n        new Vue({\r\n            el: '#app',\r\n            data: {\r\n                receptionTypes: []\r\n            },\r\n            methods: {\r\n                getTypes() {\r\n\r\n                    \/\/ reception_types\u306e\u30c7\u30fc\u30bf\u53d6\u5f97\r\n                    axios.get('\/ajax\/reception_type')\r\n                        .then(response =&gt; {\r\n\r\n                            this.receptionTypes = response.data;\r\n\r\n                        });\r\n\r\n                },\r\n                getReceptionNumbers(receptions) {\r\n\r\n                    return _.map(receptions, reception =&gt; {\r\n\r\n                        return reception.reception_number;\r\n\r\n                    });\r\n\r\n                }\r\n            },\r\n            mounted() {\r\n\r\n                this.getTypes();\r\n                setInterval(() =&gt; { \/\/ 3\u79d2\u3054\u3068\u306b\u53d7\u4ed8\u30c7\u30fc\u30bf\u3092\u66f4\u65b0\u3059\u308b\r\n\r\n                    this.getTypes();\r\n\r\n                }, 3000);\r\n\r\n            }\r\n        });\r\n\r\n    &lt;\/script&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n<p>\u898b\u305f\u76ee\u306f\u3053\u3093\u306a\u30ab\u30f3\u30b8\u3067\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-7176\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/laravel_wait_system_4.png\" alt=\"\" width=\"640\" height=\"379\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/laravel_wait_system_4.png 640w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/04\/laravel_wait_system_4-300x178.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<h1>\u30c6\u30b9\u30c8\u3057\u3066\u307f\u308b<\/h1>\n<p>\u3067\u306f\u3001\u3053\u3053\u307e\u3067\u3067\u4e00\u65e6\u30c6\u30b9\u30c8\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u2757<br \/>\n<code>YouTube<\/code>\u306b\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9\u3057\u305f\u52d5\u753b\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><iframe loading=\"lazy\" src=\"https:\/\/www.youtube.com\/embed\/mdc6jPtmnYA\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<h1>\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b<\/h1>\n<p>\u4eca\u56de\u306f\u4e88\u60f3\u3057\u3066\u305f\u4ee5\u4e0a\u306b\u30b3\u30fc\u30c9\u3082\u8a18\u4e8b\u3082\u9577\u304f\u306a\u3063\u3066\u3057\u307e\u3063\u305f\u306e\u3067\u3001\u4ee5\u4e0b\uff12\u56de\u3067\u304a\u5c4a\u3051\u3059\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002<\/p>\n<ul>\n<li>\u7a93\u53e3\u306e\u53d7\u4ed8\u756a\u53f7\u30b7\u30b9\u30c6\u30e0\u3092\u3064\u304f\u308b\u30fbLaravel\u7de8<\/li>\n<li>\u7a93\u53e3\u306e\u53d7\u4ed8\u756a\u53f7\u30b7\u30b9\u30c6\u30e0\u3092\u3064\u304f\u308b\u30fbPython\u7de8<\/li>\n<\/ul>\n<p>\u305d\u306e\u305f\u3081\u3001\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306e\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u306f\u6b21\u56de\u8a18\u4e8b\u3067\u884c\u3063\u3066\u304f\u3060\u3055\u3044\u3002\uff08\u91e3\u308a\u30bf\u30a4\u30c8\u30eb\u307f\u305f\u3044\u306b\u306a\u3063\u3066\u30b4\u30e1\u30f3\u30ca\u30b5\u30a4\ud83d\ude2b\uff09<\/p>\n<h1>\u304a\u308f\u308a\u306b<\/h1>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u4eca\u56de\u306f\u3053\u306e\u30d6\u30ed\u30b0\u521d\u306e\uff12\u56de\u306b\u5206\u3051\u305f\u8a18\u4e8b\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>\u5143\u3005\u306f\u3001\u53d7\u4ed8\u3092\u4e00\u4eba\u305a\u3064\u3067\u8003\u3048\u3066\u3044\u305f\u306e\u3067\u3082\u3063\u3068\u30b7\u30f3\u30d7\u30eb\u3060\u3063\u305f\u3093\u3067\u3059\u3051\u3069\u3001\u305b\u3063\u304b\u304f\u30ec\u30b7\u30fc\u30c8\u30fb\u30d7\u30ea\u30f3\u30bf\u3082\u8cb7\u3063\u305f\u3057\u3001\u3042\u308c\u3082\u3053\u308c\u3082\u3001\u3001\u3001\u3068\u8003\u3048\u308b\u3068\u30b3\u30fc\u30c9\u306e\u30dc\u30ea\u30e5\u30fc\u30e0\u304c\u5897\u3048\u3066\u3057\u307e\u3044\u307e\u3057\u305f\ud83d\udca6<\/p>\n<p>\u305d\u308c\u306b\u3057\u3066\u3082\u3001\u6280\u8853\u306e\u767a\u5c55\u3067\u904e\u53bb\u306b\u4f55\u767e\u4e07\u5358\u4f4d\u306e\u8cbb\u7528\u304c\u304b\u304b\u3063\u3066\u3044\u305f\u3082\u306e\u304c\u4eca\u30ea\u30fc\u30ba\u30ca\u30d6\u30eb\u306b\u958b\u767a\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u30b9\u30b4\u30a4\u3067\u3059\u306d\u3002<\/p>\n<p>\u305d\u306e\u6614\u306f\u96fb\u5353\u3082\uff11\u4e07\u5186\u3050\u3089\u3044\u3057\u3066\u305f\u306e\u304c\u3001\u4eca\u306f\u30c0\u30a4\u30bd\u30fc\u3067\u58f2\u3063\u3066\u307e\u3059\u3057\u3001\u30d1\u30bd\u30b3\u30f3<span style=\"font-size: 1rem;\">\u3082\u30e9\u30ba\u30d9\u30ea\u30fc\u30d1\u30a4\u306a\u3089\u30e1\u30e2\u30ea\uff14GB\u304c\uff11\u4e07\u5186\u4ee5\u4e0b\u3067\u8cb7\u3048\u308b\u306e\u306f\u51b7\u9759\u306b\u8003\u3048\u308b\u3068\u9a5a\u304f\u3070\u304b\u308a\u3067\u3059\ud83c\udf89\u2728<\/span><\/p>\n<p>\u4f55\u306b\u305b\u3088\u3001\u6700\u7d42\u7684\u306b\u30b3\u30fc\u30c9\u3092\u5c11\u306a\u304f\u3059\u308b\u3088\u3046\u306b\u3082\u3063\u3066\u3044\u304d\u307e\u3057\u305f\u306e\u3067\u3001\u305c\u3072\u6b21\u56de\u306ePython\u7de8\u3082\u304a\u697d\u3057\u307f\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u3067\u306f\u3067\u306f\u301c\u2757<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4445 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/no_2.png\" alt=\"\" width=\"370\" height=\"310\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/no_2.png 370w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/no_2-300x251.png 300w\" sizes=\"auto, (max-width: 370px) 100vw, 370px\" \/><\/p>\n<p style=\"text-align: center;\">\u300cOS\u3082Linux\u306a\u3089\u3001<br \/>\n\u7121\u6599\u3067\u3059\u3088\ud83d\udc4d\u300d<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u5148\u65e5\u78ba\u5b9a\u7533\u544a\u306b\u884c\u3063\u305f\u306e\u3067\u3059\u304c\u3001\u305d\u3053\u306b\u306f\u79c1\u4ee5\u5916\u306b\u3082\u305f\u304f\u3055\u3093\u306e\u65b9\u304c\u3044\u3089\u3063\u3057\u3083\u3063\u3066\u3066\u8077\u54e1\u306e\u65b9\u3082\u5168\u529b\u3067\u5bfe\u5fdc\u3055\u308c\u3066\u3044\u308b\u3088\u3046\u3067\u3057\u305f\u3002 \u305d\u306e\u305f\u3081\u3001\u5165\u308a\u53e3\u3067\u300c\u53d7\u4ed8\u756a\u53f7 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.capilano-fw.com\/?p=7168\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;\u7a93\u53e3\u306e\u53d7\u4ed8\u756a\u53f7\u30b7\u30b9\u30c6\u30e0\u3092\u3064\u304f\u308b\u30fbLaravel\u7de8\uff08\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u53ef\uff09&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":7193,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-7168","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-laravel"],"_links":{"self":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/7168","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=7168"}],"version-history":[{"count":13,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/7168\/revisions"}],"predecessor-version":[{"id":7211,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/7168\/revisions\/7211"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/media\/7193"}],"wp:attachment":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7168"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7168"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7168"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}