{"id":9269,"date":"2021-07-05T07:00:26","date_gmt":"2021-07-04T22:00:26","guid":{"rendered":"https:\/\/blog.capilano-fw.com\/?p=9269"},"modified":"2021-06-18T18:06:25","modified_gmt":"2021-06-18T09:06:25","slug":"laravel-%e3%81%a7%e3%80%8c%e6%99%82%e9%96%93%e6%9e%a0%e3%80%8d%e3%81%8c%e8%a8%ad%e5%ae%9a%e3%81%a7%e3%81%8d%e3%82%8b%e9%83%a8%e5%b1%8b%e4%ba%88%e7%b4%84%e3%82%b7%e3%82%b9%e3%83%86%e3%83%a0%e3%82%92","status":"publish","type":"post","link":"https:\/\/blog.capilano-fw.com\/?p=9269","title":{"rendered":"Laravel \u3067\u300c\u6642\u9593\u67a0\u300d\u304c\u8a2d\u5b9a\u3067\u304d\u308b\u90e8\u5c4b\u4e88\u7d04\u30b7\u30b9\u30c6\u30e0\u3092\u3064\u304f\u308b"},"content":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u3053\u306e\u9593\u5730\u5143\u30cb\u30e5\u30fc\u30b9\u3067\u3042\u308b\u30b8\u30e0\u304c\u9589\u5e97\u3059\u308b\u3068\u3044\u3046\u8a71\u3092\u77e5\u308a\u307e\u3057\u305f\u3002\u5b9f\u306f\u3053\u306e\u30b8\u30e0\u306e\u4e88\u7d04\u30b7\u30b9\u30c6\u30e0\u958b\u767a\u306b\u53c2\u52a0\u3057\u305f\u3053\u3068\u304c\u3042\u308b\u306e\u3067\u3001\u5c11\u3057\u5bc2\u3057\u3044\u6c17\u6301\u3061\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>\u3068\u306f\u3044\u3048\u3001\u5f53\u6642\u306f<code>CakePHP<\/code>\u3059\u3089\u8a71\u984c\u306b\u306a\u3063\u3066\u3044\u306a\u304b\u3063\u305f\u5927\u6614\u306a\u306e\u3067\u3001\u300c<strong>\u4eca\u958b\u767a\u3059\u308b\u3068\u3057\u305f\u3089\u5168\u7136\u52b4\u529b\u304c\u9055\u3046\u3093\u3060\u308d\u3046\u306a<\/strong>\u300d\u3068\u3082\u611f\u3058\u307e\u3057\u305f\u3002\uff08\u30ac\u30e9\u30b1\u30fc\uff13\u30ad\u30e3\u30ea\u30a2\u5bfe\u5fdc\u3067\u6ce3\u304b\u3055\u308c\u307e\u3057\u305f\ud83d\ude2b\uff09<\/p>\n<p>\u305d\u3057\u3066\u3001\u4eca\u56de\u306f<code>Laravel<\/code>\u3092\u4f7f\u3063\u3066\u300c<strong>\u90e8\u5c4b\u306e\u4e88\u7d04\u30b7\u30b9\u30c6\u30e0<\/strong>\u300d\u3092\u4f5c\u3063\u3066\u307f\u3088\u3046\u3068\u601d\u3046\u306e\u3067\u3059\u304c\u3001\u305b\u3063\u304b\u304f\u4f5c\u308b\u304b\u3089\u306b\u306f\u4f55\u304b\u3082\u3046\uff11\u3064\u7279\u5fb4\u3092\u3064\u3051\u305f\u3044\u306a\u3068\u8003\u3048\u3066\u3044\u308b\u3068\u3001\u3042\u308b\u30a2\u30a4\u30c7\u30a2\u304c\u601d\u3044\u6d6e\u304b\u3073\u307e\u3057\u305f\u3002<\/p>\n<p><strong style=\"font-size: 35px;\">\u90e8\u5c4b\u3054\u3068\u306b\u300c\u6642\u9593\u67a0\u300d\u3092\u8a2d\u5b9a\u3067\u304d\u308b<\/strong><\/p>\n<p>\u6a5f\u80fd\u3067\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u3082\u306e\u3067\u3059\u3002<\/p>\n<ul>\n<li>A\u3068\u3044\u3046\u90e8\u5c4b\u306f\u300c30\u5206\u523b\u307f\u300d\u3067\u4e88\u7d04\u3067\u304d\u308b<\/li>\n<li>B\u3068\u3044\u3046\u90e8\u5c4b\u306f\u300c20\u5206\u523b\u307f\u300d\u3067\u4e88\u7d04\u3067\u304d\u308b<\/li>\n<li>C\u3068\u3044\u3046\u90e8\u5c4b\u306f\u300c1\u6642\u9593\u5206\u523b\u307f\u300d\u3067\u4e88\u7d04\u3067\u304d\u308b<\/li>\n<\/ul>\n<p>\u3064\u307e\u308a\u3001\u90e8\u5c4b\u3054\u3068\u306b\u4e88\u7d04\u3067\u304d\u308b\u6761\u4ef6\u304c\u9055\u3063\u3066\u3044\u3066\u3082\u5bfe\u5fdc\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<p>\u305d\u3053\u3067\u2757<\/p>\n<p>\u4eca\u56de\u306f\u3001<code>Laravel<\/code>\u3067\u300c<strong>\u6642\u9593\u67a0\u304c\u8a2d\u5b9a\u3067\u304d\u308b\u90e8\u5c4b\u4e88\u7d04\u30b7\u30b9\u30c6\u30e0<\/strong>\u300d\u3092\u4f5c\u3063\u3066\u307f\u308b\u3053\u3068\u306b\u3057\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\ude0a\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\" \/>\u300cPC\u307e\u308f\u308a\u306e\u6383\u9664\u306b\u306f<br \/>\n\u30b9\u30dd\u30f3\u30b8\u3092\u4f7f\u3063\u3066\u307e\u3059\u300d<\/p>\n<p><strong>\u958b\u767a\u74b0\u5883\uff1a<\/strong> Laravel 8.x<\/p>\n<h1><span id=\"i\">\u524d\u63d0\u3068\u3057\u3066<\/span><\/h1>\n<p>\u4eca\u56de\u306f\u4e88\u7d04\u306b\u30ed\u30b0\u30a4\u30f3\u304c\u5fc5\u9808\u306e\u30b7\u30b9\u30c6\u30e0\u3092\u3064\u304f\u308a\u307e\u3059\u3002\u305d\u306e\u305f\u3081\u3001\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3001\u30c6\u30b9\u30c8\u30e6\u30fc\u30b6\u30fc\u304c<code>users<\/code>\u30c6\u30fc\u30d6\u30eb\u306b\u767b\u9332\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u304c\u524d\u63d0\u3067\u3059\u3002<\/p>\n<p>\u3082\u3057\u307e\u3060\u306e\u65b9\u306f\u4ee5\u4e0b\u3092\u53c2\u8003\u306b\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><strong>\ud83d\udcdd\u00a0\u53c2\u8003\u30da\u30fc\u30b8<\/strong><\/p>\n<ul>\n<li><a href=\"https:\/\/blog.capilano-fw.com\/?p=8301\">Laravel Breeze\u3067\u300c\u30b7\u30f3\u30d7\u30eb\u306a\u300d\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/a><\/li>\n<li><a href=\"https:\/\/blog.capilano-fw.com\/?p=7827\">Laravel8.x\u4ee5\u964d\u3067\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u65b9\u6cd5<\/a><\/li>\n<\/ul>\n<h1>\u30e2\u30c7\u30eb\uff06\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u3064\u304f\u308b<\/h1>\n<p>\u3067\u306f\u3001\u307e\u305a\u306f\u30e2\u30c7\u30eb\uff06\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u306eDB\u307e\u308f\u308a\u304b\u3089\u3064\u304f\u3063\u3066\u3044\u304d\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 make:model Room -m<\/strong><\/pre>\n<pre><strong>php artisan make:model Reservation -m<\/strong><\/pre>\n<p>\u3059\u308b\u3068\u3001\u30e2\u30c7\u30eb\uff06\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u30fb\u30d5\u30a1\u30a4\u30eb\u304c\u4e00\u6c17\u306b\u4f5c\u6210\u3055\u308c\u308b\u306e\u3067\u3001\u4e2d\u8eab\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n<p><strong>database\/migrations\/****_**_**_******_create_rooms_table.php<\/strong><\/p>\n<pre>\/\/ \u7701\u7565\r\n\r\npublic function up()\r\n{\r\n    <strong>Schema::create('rooms', function (Blueprint $table) {<\/strong>\r\n<strong>        $table-&gt;id();<\/strong>\r\n<strong>        $table-&gt;string('name')-&gt;comment('\u90e8\u5c4b\u540d');<\/strong>\r\n<strong>        $table-&gt;unsignedInteger('time_steps')-&gt;comment('\u6642\u9593\u67a0');<\/strong>\r\n<strong>        $table-&gt;timestamps();<\/strong>\r\n<strong>    });<\/strong>\r\n}<\/pre>\n<p><strong>database\/migrations\/****_**_**_******_create_reservations_table.php<\/strong><\/p>\n<pre>\/\/ \u7701\u7565\r\n\r\npublic function up()\r\n{\r\n    <strong>Schema::create('reservations', function (Blueprint $table) {<\/strong>\r\n<strong>        $table-&gt;id();<\/strong>\r\n<strong>        $table-&gt;unsignedBigInteger('user_id')-&gt;comment('\u30e6\u30fc\u30b6\u30fcID');<\/strong>\r\n<strong>        $table-&gt;unsignedBigInteger('room_id')-&gt;comment('\u90e8\u5c4bID');<\/strong>\r\n<strong>        $table-&gt;dateTime('starts_at')-&gt;comment('\u958b\u59cb\u65e5\u6642');<\/strong>\r\n<strong>        $table-&gt;timestamps();<\/strong>\r\n\r\n<strong>        $table-&gt;foreign('user_id')-&gt;references('id')-&gt;on('users');<\/strong>\r\n<strong>        $table-&gt;foreign('room_id')-&gt;references('id')-&gt;on('rooms');<\/strong>\r\n<strong>    });<\/strong>\r\n}<\/pre>\n<p><strong>app\/Models\/Room.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 Room extends Model\r\n{\r\n    use HasFactory;\r\n\r\n    <strong>protected $appends = ['time_step_values'];<\/strong>\r\n\r\n<strong>    \/\/ Accessor<\/strong>\r\n<strong>    public function getTimeStepValuesAttribute() { \/\/ \uff11\u6642\u9593\u306e\u9593\u306b\u4e88\u7d04\u3067\u304d\u308b\u300c\u5206\u300d\u3092\u53d6\u5f97\u3059\u308b<\/strong>\r\n\r\n<strong>        $time_step_values = [];<\/strong>\r\n<strong>        $count = 60 \/ $this-&gt;time_steps;<\/strong>\r\n\r\n<strong>        for($i = 0 ; $i &lt; $count ; $i++) {<\/strong>\r\n\r\n<strong>            $time_step_values[] = $this-&gt;time_steps * $i;<\/strong>\r\n\r\n<strong>        }<\/strong>\r\n\r\n<strong>        return $time_step_values;<\/strong>\r\n\r\n<strong>    }<\/strong>\r\n}<\/pre>\n<p>\u3053\u3053\u3067\u8ffd\u52a0\u3057\u305f<code>getTimeStepValuesAttribute()<\/code>\u306f\u3001<code>Laravel<\/code>\u306e<code>Accessor<\/code>\u3068\u547c\u3070\u308c\u308b\u4fbf\u5229\u6a5f\u80fd\u3067\u3001<strong>\uff11\u6642\u9593\u306e\u9593\u306b\u4e88\u7d04\u3067\u304d\u308b\u300c\u5206\u300d<\/strong>\u304c\u7c21\u5358\u306b\u53d6\u5f97\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u3001\u4ee5\u4e0b\u306e\u4f8b\u3092\u898b\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre>$room = \\App\\Models\\Room::first();\r\ndd(<strong>$room-&gt;time_step_values<\/strong>); \/\/ 15\u5206\u523b\u307f\u306e\u5834\u5408\uff1a [0, 15, 30, 45]<\/pre>\n<p>\u3053\u306e\u3088\u3046\u306b\u3001\u914d\u5217\u3067\u4e88\u7d04\u958b\u59cb\u304c\u53ef\u80fd\u306a\u300c\u5206\u300d\u304c\u53d6\u5f97\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u306a\u304a\u3001<code>$appends<\/code>\u306b\u3053\u306e<code>time_step_values<\/code>\u3092\u30bb\u30c3\u30c8\u3057\u3066\u3044\u308b\u306e\u306f\u3001\u300c<strong>\u5e38\u306b\u3053\u306e\u5024\u3092\u53d6\u5f97\u3057\u305f\u3044\u304b\u3089<\/strong>\u300d\u3067\u3059\u3002<\/p>\n<p>\u3064\u307e\u308a\u3001<code>$appends<\/code>\u3092\u30bb\u30c3\u30c8\u3059\u308b\u3068\u3001\u5fc5\u305a\u3053\u306e\u5024\u304c\u3064\u3044\u3066\u304f\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre><strong>$room = \\App\\Models\\Room::first();<\/strong>\r\n<strong>dd($room-&gt;toArray());<\/strong> <strong>\/\/ \ud83d\udc48 $appends \u3092\u30bb\u30c3\u30c8\u3057\u3066\u3044\u308b\u3068\u3001\u3053\u306e\u4e2d\u306b\u300c\u5206\u300d\u306e\u914d\u5217\u304c\u5165\u3063\u3066\u304f\u308b<\/strong><\/pre>\n<h1>\u30c6\u30b9\u30c8\u30c7\u30fc\u30bf\u3092\u3064\u304f\u308b<\/h1>\n<p>\u6b21\u306b\u4eca\u56de\u30c6\u30b9\u30c8\u3067\u4e88\u7d04\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b\u300c<strong>\u90e8\u5c4b<\/strong>\u300d\u30c7\u30fc\u30bf\u3092\u3064\u304f\u3063\u3066\u3044\u304d\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 make:seed RoomSeeder<\/strong><\/pre>\n<p>\u3059\u308b\u3068\u3001\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u308b\u306e\u3067\u4e2d\u8eab\u3092\u6b21\u306e\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<p><strong>database\/seeders\/RoomSeeder.php<\/strong><\/p>\n<pre>&lt;?php\r\n\r\nnamespace Database\\Seeders;\r\n\r\n<strong>use App\\Models\\Room;<\/strong>\r\nuse Illuminate\\Database\\Seeder;\r\n\r\nclass RoomSeeder extends Seeder\r\n{\r\n    \/\/ \u7701\u7565\r\n\r\n    <strong>public function run()<\/strong>\r\n<strong>    {<\/strong>\r\n<strong>        $time_steps = [15, 30, 60];<\/strong>\r\n\r\n<strong>        foreach ($time_steps as $index =&gt; $time_step) {<\/strong>\r\n\r\n<strong>            $no = $index + 1;<\/strong>\r\n\r\n<strong>            $room = new Room();<\/strong>\r\n<strong>            $room-&gt;name = '\u90e8\u5c4b'. $no;<\/strong>\r\n<strong>            $room-&gt;time_steps = $time_steps[$index];<\/strong>\r\n<strong>            $room-&gt;save();<\/strong>\r\n\r\n<strong>        }<\/strong>\r\n<strong>    }<\/strong>\r\n}<\/pre>\n<p>\u3067\u306f\u3001<code>Seeder<\/code>\u30d5\u30a1\u30a4\u30eb\u306f\u4f5c\u6210\u3059\u308b\u3060\u3051\u3067\u306f\u5b9f\u884c\u3067\u304d\u307e\u305b\u3093\u306e\u3067\u3001<code>Laravel<\/code>\u5074\u306b\u767b\u9332\u3057\u307e\u3059\u3002<\/p>\n<pre>public function run()\r\n{\r\n    \/\/ \u7701\u7565\r\n\r\n    <strong>$this-&gt;call(RoomSeeder::class);<\/strong>\r\n}<\/pre>\n<p>\u305d\u308c\u3067\u306f\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u518d\u69cb\u7bc9\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre><strong>php artisan migrate:fresh --seed<\/strong><\/pre>\n<p>\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-9274\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/06\/laravel_room_reservation_1.png\" alt=\"\" width=\"570\" height=\"324\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/06\/laravel_room_reservation_1.png 570w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/06\/laravel_room_reservation_1-300x171.png 300w\" sizes=\"auto, (max-width: 570px) 100vw, 570px\" \/><\/p>\n<h1>\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\u3064\u304f\u308b<\/h1>\n<p>\u7d9a\u3044\u3066\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\u3064\u304f\u308a\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 make:controller ReservationController<\/strong><\/pre>\n<p>\u3059\u308b\u3068\u3001\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u308b\u306e\u3067\u3001\u4e2d\u8eab\u3092\u6b21\u306e\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<pre>&lt;?php\r\n\r\nnamespace App\\Http\\Controllers;\r\n\r\n<strong>use App\\Models\\Reservation;<\/strong>\r\n<strong>use App\\Models\\Room;<\/strong>\r\nuse Illuminate\\Http\\Request;\r\n\r\nclass ReservationController extends Controller\r\n{\r\n    <strong>public function index() {<\/strong>\r\n\r\n<strong>        $rooms = Room::select('id', 'name', 'time_steps')-&gt;get();<\/strong>\r\n\r\n<strong>        return view('reservation.index')-&gt;with([<\/strong>\r\n<strong>            'rooms' =&gt; $rooms<\/strong>\r\n<strong>        ]);<\/strong>\r\n\r\n<strong>    }<\/strong>\r\n\r\n<strong>    public function store(Request $request) {<\/strong>\r\n\r\n<strong>        \/\/ TODO: \u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u306f\u7701\u7565\u3057\u3066\u3044\u307e\u3059<\/strong>\r\n\r\n<strong>        $reservation = new Reservation();<\/strong>\r\n<strong>        $reservation-&gt;user_id = auth()-&gt;id();<\/strong>\r\n<strong>        $reservation-&gt;room_id = $request-&gt;room_id;<\/strong>\r\n<strong>        $reservation-&gt;starts_at = $request-&gt;start_at;<\/strong>\r\n<strong>        $result = $reservation-&gt;save();<\/strong>\r\n\r\n<strong>        return ['result' =&gt; $result];<\/strong>\r\n\r\n<strong>    }<\/strong>\r\n\r\n<strong>    public function reservation_list(Request $request) {<\/strong>\r\n\r\n<strong>        $reservations = Reservation::select('id', 'room_id', 'starts_at')<\/strong>\r\n<strong>            -&gt;whereDate('starts_at', $request-&gt;date)<\/strong>\r\n<strong>            -&gt;get();<\/strong>\r\n\r\n<strong>        return [<\/strong>\r\n<strong>            'reservations' =&gt; $reservations<\/strong>\r\n<strong>        ];<\/strong>\r\n\r\n<strong>    }<\/strong>\r\n}<\/pre>\n<p>\u3067\u306f\u3001\u3053\u306e\u4e2d\u3067\u3084\u3063\u3066\u3044\u308b\u3053\u3068\u3092\u30e1\u30bd\u30c3\u30c9\u3054\u3068\u306b\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<h2>index()<\/h2>\n<p>\u3053\u3053\u306f\u3001\u5b9f\u969b\u306b\u30d6\u30e9\u30a6\u30b6\u304b\u3089\u30a2\u30af\u30bb\u30b9\u3055\u308c\u308b\u30da\u30fc\u30b8\u3067\u30d3\u30e5\u30fc\u3092\u8aad\u307f\u8fbc\u307f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u8868\u793a\u3092\u3057\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9275\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/06\/laravel_room_reservation_2.png\" alt=\"\" width=\"349\" height=\"367\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/06\/laravel_room_reservation_2.png 349w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/06\/laravel_room_reservation_2-285x300.png 285w\" sizes=\"auto, (max-width: 349px) 100vw, 349px\" \/><\/p>\n<p>\u307e\u305f\u3001\u30d3\u30e5\u30fc\u306b\u6e21\u3057\u3066\u3044\u308b<code>$rooms<\/code>\u306f\u3001<code>Vue.js<\/code>\u306e\u5909\u6570\u306b\u30bb\u30c3\u30c8\u3055\u308c\u3066\u30eb\u30fc\u30d7\u3067\u4e88\u7d04\u30dc\u30bf\u30f3\u3092\u63cf\u753b\u3059\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h2>store()<\/h2>\n<p><code>Ajax<\/code>\u3067\u4e88\u7d04\u3092\u767b\u9332\u3057\u307e\u3059\u3002<\/p>\n<p>\u4eca\u56de\u306f\u30c6\u30b9\u30c8\u306a\u306e\u3067\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u306f\u7701\u7565\u3057\u3066\u3044\u307e\u3059\u304c\u3001\u3053\u3053\u3067\u306f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u4e88\u7d04\u5185\u5bb9\u3092\u4fdd\u5b58\u3057\u3066\u3044\u308b\u3060\u3051\u3067\u3059\u3002<\/p>\n<p>\u203b \u306a\u304a\u3001\u79c1\u304c\u958b\u767a\u306b\u4f7f\u3063\u3066\u3044\u308b\u6709\u6599\u30a8\u30c7\u30a3\u30bf<code>phpstorm<\/code>\u3067\u306f\u3001<code>TODO:<\/code>\u3068\u66f8\u3044\u3066\u304a\u304f\u3068\u3001\u81ea\u52d5\u7684\u306b\u307e\u3068\u3081\u3066\u304f\u308c\u308b\uff08\u306e\u3092\u6700\u8fd1\u767a\u898b\u3057\u305f\ud83d\ude02\uff09\u306e\u3067\u3053\u306e\u3088\u3046\u306b\u66f8\u3044\u3066\u3044\u307e\u3059\u3002<\/p>\n<h2>reservation_list()<\/h2>\n<p>\u3053\u3053\u3082<code>Ajax<\/code>\u3067\u30a2\u30af\u30bb\u30b9\u3055\u308c\u308b\u90e8\u5206\u3067\u3059\u304c\u3001\u3059\u3067\u306b\u4e88\u7d04\u6e08\u307f\u306e\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3059\u308b\u305f\u3081\u306b\u7528\u610f\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u307e\u305f\u3001\u53d6\u5f97\u3059\u308b\u6761\u4ef6\u306f\u300c<strong>\u8a72\u5f53\u3059\u308b\u5e74\u6708\u65e5\u306e\u5168\u4e88\u7d04\u30c7\u30fc\u30bf<\/strong>\u300d\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u203b \u3061\u306a\u307f\u306b\u3001<code>whereYear()<\/code>, <code>whereMonth(), whereDay(), whereTime()<\/code>\u3092\u4f7f\u3046\u3068\u300c\u8a72\u5f53\u3059\u308b\u5e74\u3001\u6708\u3001\u65e5\u3001\u6642\u9593\u300d\u3067\u7d5e\u308a\u8fbc\u307f\u304c\u3067\u304d\u307e\u3059\u3002<code>Laravel<\/code>\u306f\u3084\u3063\u3071\u308a\u4fbf\u5229\u3067\u3059\u306d\ud83d\udc4d<\/p>\n<h1>\u30d3\u30e5\u30fc\u3092\u3064\u304f\u308b<\/h1>\n<p>\u3067\u306f\u6b21\u306b\u30d3\u30e5\u30fc\uff08HTML\u90e8\u5206\uff09\u3092\u4f5c\u3063\u3066\u3044\u304d\u307e\u3059\u3002<br \/>\n\u4ee5\u4e0b\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><strong>resources\/views\/reservation\/index.blade.php<\/strong><\/p>\n<pre><strong>&lt;html&gt;<\/strong>\r\n<strong>&lt;head&gt;<\/strong>\r\n<strong>    &lt;link rel=\"stylesheet\" href=\"https:\/\/cdn.jsdelivr.net\/npm\/bootstrap@4.6.0\/dist\/css\/bootstrap.min.css\"&gt;<\/strong>\r\n<strong>&lt;\/head&gt;<\/strong>\r\n<strong>&lt;body&gt;<\/strong>\r\n<strong>&lt;div id=\"app\"&gt;<\/strong>\r\n<strong>    &lt;div class=\"p-3\"&gt;<\/strong>\r\n<strong>        &lt;div class=\"btn-group mb-4\"&gt;<\/strong>\r\n<strong>            &lt;button type=\"button\" class=\"btn btn-outline-secondary\" @click=\"moveDate(-1)\"&gt;&amp;lt;&lt;\/button&gt;<\/strong>\r\n<strong>            &lt;button type=\"button\" class=\"btn btn-outline-secondary\" v-text=\"date\"&gt;&lt;\/button&gt;<\/strong>\r\n<strong>            &lt;button type=\"button\" class=\"btn btn-outline-secondary\" @click=\"moveDate(1)\"&gt;&amp;gt;&lt;\/button&gt;<\/strong>\r\n<strong>        &lt;\/div&gt;<\/strong>\r\n<strong>        &lt;div class=\"mb-5\" v-for=\"room in rooms\"&gt;<\/strong>\r\n<strong>            &lt;h4&gt;<\/strong>\r\n<strong>                &lt;span class=\"badge rounded-pill bg-info text-dark\" v-text=\"room.name\"&gt;Info&lt;\/span&gt;<\/strong>\r\n<strong>            &lt;\/h4&gt;<\/strong>\r\n<strong>            &lt;div v-for=\"hours in allHours\"&gt;<\/strong>\r\n<strong>                &lt;div class=\"row\"&gt;<\/strong>\r\n<strong>                    &lt;div class=\"col-auto pr-5 py-2\"&gt;<\/strong>\r\n<strong>                        &lt;span v-text=\"getPaddedNumber(hours)\"&gt;&lt;\/span&gt;\u6642<\/strong>\r\n<strong>                    &lt;\/div&gt;<\/strong>\r\n<strong>                    &lt;div class=\"col-auto p-2\" v-for=\"minutes in room.time_step_values\"&gt;<\/strong>\r\n<strong>                        &lt;button<\/strong>\r\n<strong>                            class=\"btn btn-outline-dark\"<\/strong>\r\n<strong>                            data-toggle=\"tooltip\"<\/strong>\r\n<strong>                            :title=\"getTimeRange(hours, minutes, room.time_steps)\"<\/strong>\r\n<strong>                            v-text=\"getPaddedNumber(minutes)\"<\/strong>\r\n<strong>                            :disabled=\"!isReservationAvailable(room.id, hours, minutes)\"<\/strong>\r\n<strong>                            @click=\"reserve(room.id, hours, minutes)\"&gt;<\/strong>\r\n<strong>                        &lt;\/button&gt;<\/strong>\r\n<strong>                    &lt;\/div&gt;<\/strong>\r\n<strong>                &lt;\/div&gt;<\/strong>\r\n<strong>            &lt;\/div&gt;<\/strong>\r\n<strong>        &lt;\/div&gt;<\/strong>\r\n<strong>    &lt;\/div&gt;<\/strong>\r\n<strong>&lt;\/div&gt;<\/strong>\r\n<strong>&lt;script src=\"https:\/\/unpkg.com\/vue@3.0.11\/dist\/vue.global.prod.js\"&gt;&lt;\/script&gt;<\/strong>\r\n<strong>&lt;script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/axios\/0.21.1\/axios.min.js\"&gt;&lt;\/script&gt;<\/strong>\r\n<strong>&lt;script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/luxon\/1.27.0\/luxon.min.js\"&gt;&lt;\/script&gt;<\/strong>\r\n<strong>&lt;script src=\"https:\/\/code.jquery.com\/jquery-3.5.1.slim.min.js\"&gt;&lt;\/script&gt;<\/strong>\r\n<strong>&lt;script src=\"https:\/\/cdn.jsdelivr.net\/npm\/popper.js@1.16.1\/dist\/umd\/popper.min.js\"&gt;&lt;\/script&gt;<\/strong>\r\n<strong>&lt;script src=\"https:\/\/cdn.jsdelivr.net\/npm\/bootstrap@4.6.0\/dist\/js\/bootstrap.min.js\"&gt;&lt;\/script&gt;<\/strong>\r\n<strong>&lt;script&gt;<\/strong>\r\n\r\n<strong>    Vue.createApp({<\/strong>\r\n<strong>        data() {<\/strong>\r\n<strong>            return {<\/strong>\r\n<strong>                reservations: [],<\/strong>\r\n<strong>                allHours: [],<\/strong>\r\n<strong>                dt: null,<\/strong>\r\n<strong>                rooms: @json($rooms)<\/strong>\r\n<strong>            }<\/strong>\r\n<strong>        },<\/strong>\r\n<strong>        methods: {<\/strong>\r\n<strong>            getReservations() {<\/strong>\r\n\r\n<strong>                const date = this.dt.toFormat('yyyy-MM-dd');<\/strong>\r\n<strong>                const url = '{{ route('reservation.reservation_list') }}?date='+ date;<\/strong>\r\n\r\n<strong>                axios.get(url)<\/strong>\r\n<strong>                    .then(response =&gt; {<\/strong>\r\n\r\n<strong>                        this.reservations = response.data.reservations;<\/strong>\r\n\r\n<strong>                    });<\/strong>\r\n\r\n<strong>            },<\/strong>\r\n<strong>            getPaddedNumber(number) {<\/strong>\r\n\r\n<strong>                return number.toString().padStart(2, '0'); \/\/ \u30bc\u30ed\u57cb\u3081\u3057\u3066\u5fc5\u305a\uff12\u30b1\u30bf\u306b\u3059\u308b<\/strong>\r\n\r\n<strong>            },<\/strong>\r\n<strong>            getTimeRange(hours, minutes, timeSteps) {<\/strong>\r\n\r\n<strong>                const startDt = this.dt.set({<\/strong>\r\n<strong>                    hours: hours,<\/strong>\r\n<strong>                    minutes: minutes<\/strong>\r\n<strong>                })<\/strong>\r\n<strong>                const endDt = startDt.plus({ minutes: timeSteps });<\/strong>\r\n<strong>                return startDt.toFormat('H:mm') +' \u301c '+ endDt.toFormat('H:mm') +' \u306e\u3054\u4e88\u7d04';<\/strong>\r\n\r\n<strong>            },<\/strong>\r\n<strong>            isReservationAvailable(roomId, hours, minutes) {<\/strong>\r\n\r\n<strong>                const today = luxon.DateTime.now().startOf('day');<\/strong>\r\n\r\n<strong>                if(this.dt &lt; today) {<\/strong>\r\n\r\n<strong>                    return false;<\/strong>\r\n\r\n<strong>                }<\/strong>\r\n\r\n<strong>                const dt = this.dt.set({<\/strong>\r\n<strong>                    hours: hours,<\/strong>\r\n<strong>                    minutes: minutes<\/strong>\r\n<strong>                })<\/strong>\r\n<strong>                const startsAt = dt.toFormat('yyyy-MM-dd HH:mm:00');<\/strong>\r\n<strong>                const hasReservation = this.reservations.some(reservation =&gt; { \/\/ \u6307\u5b9a\u3057\u305f\u6761\u4ef6\u304c\u5b58\u5728\u3057\u3066\u305f\u3089 true<\/strong>\r\n\r\n<strong>                    return (<\/strong>\r\n<strong>                        parseInt(reservation.room_id) === parseInt(roomId) &amp;&amp;<\/strong>\r\n<strong>                        reservation.starts_at === startsAt<\/strong>\r\n<strong>                    )<\/strong>\r\n\r\n<strong>                });<\/strong>\r\n\r\n<strong>                return !hasReservation;<\/strong>\r\n\r\n<strong>            },<\/strong>\r\n<strong>            moveDate(days) {<\/strong>\r\n\r\n<strong>                this.dt = this.dt.plus({<\/strong>\r\n<strong>                    days: days<\/strong>\r\n<strong>                });<\/strong>\r\n\r\n<strong>            },<\/strong>\r\n<strong>            reserve(roomId, hours, minutes) {<\/strong>\r\n\r\n<strong>                if(confirm('\u4e88\u7d04\u3057\u307e\u3059\u3002\u3088\u308d\u3057\u3044\u3067\u3059\u304b\uff1f')) {<\/strong>\r\n\r\n<strong>                    const dt = this.dt.set({<\/strong>\r\n<strong>                        hours: hours,<\/strong>\r\n<strong>                        minutes: minutes<\/strong>\r\n<strong>                    });<\/strong>\r\n\r\n<strong>                    const url = '{{ route('reservation.store') }}';<\/strong>\r\n<strong>                    const params = {<\/strong>\r\n<strong>                        room_id: roomId,<\/strong>\r\n<strong>                        start_at: dt.toFormat('yyyy-MM-dd HH:mm')<\/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>                                this.getReservations();<\/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>        },<\/strong>\r\n<strong>        computed: {<\/strong>\r\n<strong>            date() {<\/strong>\r\n\r\n<strong>                if(this.dt) {<\/strong>\r\n\r\n<strong>                    return this.dt.toFormat('yyyy\/MM\/dd');<\/strong>\r\n\r\n<strong>                }<\/strong>\r\n\r\n<strong>                return '';<\/strong>\r\n\r\n<strong>            }<\/strong>\r\n<strong>        },<\/strong>\r\n<strong>        watch: {<\/strong>\r\n<strong>            dt() {<\/strong>\r\n\r\n<strong>                this.getReservations();<\/strong>\r\n\r\n<strong>            }<\/strong>\r\n<strong>        },<\/strong>\r\n<strong>        mounted() {<\/strong>\r\n\r\n<strong>            for(let i = 0 ; i &lt; 24 ; i++) {<\/strong>\r\n\r\n<strong>                this.allHours.push(i);<\/strong>\r\n\r\n<strong>            }<\/strong>\r\n\r\n<strong>            this.dt = luxon.DateTime.now().startOf('day');<\/strong>\r\n\r\n<strong>            Vue.nextTick(() =&gt; {<\/strong>\r\n\r\n<strong>                $('[data-toggle=\"tooltip\"]').tooltip({<\/strong>\r\n<strong>                    placement: 'right'<\/strong>\r\n<strong>                });<\/strong>\r\n\r\n<strong>            });<\/strong>\r\n\r\n<strong>        }<\/strong>\r\n<strong>    }).mount('#app');<\/strong>\r\n\r\n<strong>&lt;\/script&gt;<\/strong>\r\n<strong>&lt;\/body&gt;<\/strong>\r\n<strong>&lt;\/html&gt;<\/strong><\/pre>\n<p>\u4eca\u56de\u3053\u306e\u90e8\u5206\u304c\u4e00\u756a\u30b3\u30fc\u30c9\u304c\u9577\u304f\u306a\u3063\u3066\u3057\u307e\u3063\u305f\u306e\u3067\u3059\u304c\u3001\u65e5\u4ed8\u7ba1\u7406\u3092\u3059\u308b<code>luxon<\/code>\uff08<code>moment.js<\/code>\u306e\u5f8c\u7d99\u30d1\u30c3\u30b1\u30fc\u30b8\uff09\u3055\u3048\u7406\u89e3\u3057\u3066\u3044\u308c\u3070\u305d\u308c\u307b\u3069\u96e3\u3057\u3044\u5185\u5bb9\u3067\u306f\u306a\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p><strong>\ud83d\udcdd \u53c2\u8003\u30da\u30fc\u30b8\uff1a<\/strong><a href=\"https:\/\/blog.capilano-fw.com\/?p=9077\">\u3010JavaScript\u3011Luxon \u3067\u65e5\u4ed8\u306e\u64cd\u4f5c\u30fb\u5168\u5b9f\u4f8b38\u4ef6\uff01<\/a><\/p>\n<p>\u3053\u306e\u4e2d\u3067\u4e00\u756a\u91cd\u8981\u306a\u306e\u304c\u3001\u300c<strong>\u3059\u3067\u306b\u4e88\u7d04\u6e08\u307f\u306e\u6642\u9593\u67a0\u306f\u64cd\u4f5c\u3067\u304d\u306a\u3044\u3088\u3046\u306b\u3059\u308b<\/strong>\u300d\u3068\u3044\u3046\u3053\u3068\u3067\u3059\u3002<\/p>\n<p>\u305d\u306e\u5f79\u76ee\u3092\u62c5\u3063\u3066\u3044\u308b\u306e\u304c<code>isReservationAvailable()<\/code>\u3067\u3001\u3053\u306e\u4e2d\u3067\u306f\u3001<code>Ajax<\/code>\u3092\u901a\u3057\u3066<code>reservation_list()<\/code>\u304b\u3089\u53d6\u5f97\u3057\u305f\u300c<strong>\u4e88\u7d04\u6e08\u307f\u30c7\u30fc\u30bf<\/strong>\u300d\u3068\u3001\u305d\u308c\u305e\u308c\u306e\u6642\u9593\u67a0\u3092\u6bd4\u3079\u3001\u3082\u3057<strong>\u4e88\u7d04\u30c7\u30fc\u30bf\u304c\u3042\u308b\u5834\u5408\u306f\u3001\u300cdisabled\u300d\u3092\u6709\u52b9\u306b\u3057\u3066\u30dc\u30bf\u30f3\u64cd\u4f5c\u3067\u304d\u306a\u3044\u3088\u3046\u306b<\/strong>\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<h1>\u30eb\u30fc\u30c8\u3092\u3064\u304f\u308b<\/h1>\n<pre><strong>use App\\Http\\Controllers\\ReservationController;<\/strong>\r\n\r\n\/\/ \u7701\u7565\r\n\r\n<strong>Route::prefix('reservation')-&gt;middleware('auth')-&gt;group(function(){<\/strong>\r\n\r\n<strong>    Route::get('\/', [ReservationController::class, 'index'])-&gt;name('reservation.index');<\/strong>\r\n<strong>    Route::get('\/reservation_list', [ReservationController::class, 'reservation_list'])-&gt;name('reservation.reservation_list');<\/strong>\r\n<strong>    Route::post('\/', [ReservationController::class, 'store'])-&gt;name('reservation.store');<\/strong>\r\n\r\n<strong>});<\/strong><\/pre>\n<p>\u5185\u5bb9\u3068\u3057\u3066\u306f\u3001\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3067\u3064\u304f\u3063\u305f\u5404\u30e1\u30bd\u30c3\u30c9\u306bURL\u3092\u5bfe\u5fdc\u3055\u305b\u3001\u5f8c\u3067\u4f7f\u3044\u3084\u3059\u3044\u3088\u3046\u306b<code>name()<\/code>\u3092\u3064\u3051\u3066\u3044\u308b\u3060\u3051\u3067\u3059\u3002<\/p>\n<h1>\u30c6\u30b9\u30c8\u3057\u3066\u307f\u308b<\/h1>\n<p>\u3067\u306f\u3001\u5b9f\u969b\u306b\u30c6\u30b9\u30c8\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u2757<br \/>\n\u307e\u305a\u5148\u306b\u30ed\u30b0\u30a4\u30f3\u3092\u3057\u3066\u304b\u3089\u3001\u300c<strong>http:\/\/******\/reservation\/<\/strong>\u300d\u306b\u30a2\u30af\u30bb\u30b9\u3057\u307e\u3059\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-9275\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/06\/laravel_room_reservation_2.png\" alt=\"\" width=\"349\" height=\"367\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/06\/laravel_room_reservation_2.png 349w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/06\/laravel_room_reservation_2-285x300.png 285w\" sizes=\"auto, (max-width: 349px) 100vw, 349px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9276\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/06\/laravel_room_reservation_3.png\" alt=\"\" width=\"224\" height=\"246\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9277\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/06\/laravel_room_reservation_4.png\" alt=\"\" width=\"167\" height=\"303\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/06\/laravel_room_reservation_4.png 167w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/06\/laravel_room_reservation_4-165x300.png 165w\" sizes=\"auto, (max-width: 167px) 100vw, 167px\" \/><\/p>\n<p>\u306f\u3044\u2757<\/p>\n<p>\u30c6\u30b9\u30c8\u30c7\u30fc\u30bf\u3068\u3057\u3066\u4f5c\u6210\u3057\u305f\u90e8\u5c4b\uff11\u301c\uff13\u306b\u300c\u6642\u9593\u67a0\u3054\u3068\u306e\u300d\u4e88\u7d04\u30dc\u30bf\u30f3\u3092\u8868\u793a\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n<p>\u306a\u304a\u3001\u3053\u306e\u30dc\u30bf\u30f3\u306f\u30de\u30a6\u30b9\u3092\u5408\u308f\u305b\u308b\u3068\u30c4\u30fc\u30eb\u30c1\u30c3\u30d7\u304c\u8868\u793a\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9278\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/06\/laravel_room_reservation_5.png\" alt=\"\" width=\"223\" height=\"57\" \/><\/p>\n<p>\u3067\u306f\u3001\u3053\u306e\u307e\u307e\u30af\u30ea\u30c3\u30af\u3057\u3066\u3001\u300c<strong>0:45\u5206\u301c1:00<\/strong>\u300d\u3067\u4e88\u7d04\u3092\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-9281\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/06\/laravel_room_reservation_6.png\" alt=\"\" width=\"442\" height=\"142\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/06\/laravel_room_reservation_6.png 442w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/06\/laravel_room_reservation_6-300x96.png 300w\" sizes=\"auto, (max-width: 442px) 100vw, 442px\" \/><\/p>\n<p>\u78ba\u8a8d\u30c0\u30a4\u30a2\u30ed\u30b0\u304c\u8868\u793a\u3055\u308c\u308b\u306e\u3067OK\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002<\/p>\n<p>\u3055\u3066\u3001\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-9280\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/06\/laravel_room_reservation_7.png\" alt=\"\" width=\"429\" height=\"109\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/06\/laravel_room_reservation_7.png 429w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/06\/laravel_room_reservation_7-300x76.png 300w\" sizes=\"auto, (max-width: 429px) 100vw, 429px\" \/><\/p>\n<p>\u306f\u3044\u2757<\/p>\n<p>\u3061\u3087\u3063\u3068\u5206\u304b\u308a\u306b\u304f\u3044\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u304c\u3001\u4e88\u7d04\u304c\u3067\u304d\u305f\u306e\u3067\u30dc\u30bf\u30f3\u306e\u8272\u304c\u8584\u304f\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>\u3053\u308c\u306f\u3001<code>disabled<\/code>\u304c\u52b9\u3044\u3066\u3044\u308b\u72b6\u614b\u306a\u306e\u3067\u3001\u30de\u30a6\u30b9\u3092\u5408\u308f\u305b\u3066\u3082\u30c4\u30fc\u30eb\u30c1\u30c3\u30d7\u306f\u8868\u793a\u3055\u308c\u307e\u305b\u3093\u3057\u3001\u30af\u30ea\u30c3\u30af\u3057\u3066\u3082\u4f55\u3082\u8d77\u3053\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>\u6210\u529f\u3067\u3059\ud83d\ude0a\u2728<\/p>\n<p>\u3067\u306f\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u65b9\u3082\u78ba\u8a8d\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-9282\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/06\/laravel_room_reservation_8.png\" alt=\"\" width=\"416\" height=\"271\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/06\/laravel_room_reservation_8.png 416w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2021\/06\/laravel_room_reservation_8-300x195.png 300w\" sizes=\"auto, (max-width: 416px) 100vw, 416px\" \/><\/p>\n<p>\u306f\u3044\u2757\u30ad\u30c1\u30f3\u3068\u4e88\u7d04\u30c7\u30fc\u30bf\u304c\u767b\u9332\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u5168\u3066\u6210\u529f\u3067\u3059\ud83d\ude0a\u2728<\/p>\n<h1>\u4f01\u696d\u69d8\u3078\u306e\u3054\u63d0\u6848<\/h1>\n<p>\u4eca\u56de\u306e\u6280\u8853\u3092\u4f7f\u3048\u3070\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u3053\u3068\u304c\u5b9f\u73fe\u3067\u304d\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u90e8\u5c4b\u3054\u3068\u306b\u6642\u9593\u67a0\u3092\u6307\u5b9a\u3067\u304d\u308b\u306e\u3067\u3001\u3044\u308d\u3044\u308d\u306a\u6761\u4ef6\u306b\u5bfe\u5fdc\u3067\u304d\u308b\u4e88\u7d04\u30b7\u30b9\u30c6\u30e0\u3092\u3064\u304f\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/li>\n<li>\u90e8\u5c4b\u3060\u3051\u306b\u9650\u3089\u305a\u3001\u30c8\u30ec\u30fc\u30ca\u30fc\u3055\u3093\u3084\u8b1b\u5e2b\u3055\u3093\u306e\u4e88\u7d04\u306b\u3082\u5229\u7528\u53ef\u80fd\u3067\u3059\u3002<\/li>\n<li>\u4eca\u56de\u306f24\u6642\u9593\u4e88\u7d04\u304c\u53ef\u80fd\u3067\u3057\u305f\u304c\u3001\u3053\u308c\u3082\u90e8\u5c4b\u3054\u3068\u306b\u6761\u4ef6\u3092\u6307\u5b9a\u3059\u308b\u3088\u3046\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/li>\n<li>\u3055\u3089\u306b\u62e1\u5f35\u3057\u3066\u3001\u300c\u25cf\u65e5\u524d\u307e\u3067\u306a\u3089\u30ad\u30e3\u30f3\u30bb\u30eb\u53ef\u300d\u306e\u3088\u3046\u306a\u6a5f\u80fd\u3092\u3064\u3051\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/li>\n<\/ul>\n<p>\u3082\u3057\u3053\u3046\u3044\u3063\u305f\u5185\u5bb9\u306b\u3054\u8208\u5473\u304c\u3042\u308b\u3088\u3046\u3067\u3057\u305f\u3089\u3001\u305c\u3072\u304a\u554f\u3044\u5408\u308f\u305b\u304b\u3089\u3054\u9023\u7d61\u304f\u3060\u3055\u3044\u3002\u3069\u3046\u305e\u3088\u308d\u3057\u304f\u304a\u9858\u3044\u3044\u305f\u3057\u307e\u3059\u3002m(_ _)m<\/p>\n<h1>\u304a\u308f\u308a\u306b<\/h1>\n<p>\u3068\u3046\u3053\u3068\u3067\u3001\u4eca\u56de\u306f<code>Laravel<\/code>\u3067\u300c<strong>\u6642\u9593\u67a0\u304c\u6307\u5b9a\u3067\u304d\u308b<\/strong>\u300d\u4e88\u7d04\u30b7\u30b9\u30c6\u30e0\u3092\u4f5c\u3063\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p>\u306a\u304a\u3001\u4eca\u56deCSS\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u306b\u306f<code>2021.5.5<\/code>\u306b\u30ea\u30ea\u30fc\u30b9\u3055\u308c\u305f\u3070\u304b\u308a\u306e<code>Bootstrap 5<\/code>\u3092\u4f7f\u3046\u4e88\u5b9a\u306b\u3057\u3066\u3044\u307e\u3057\u305f\u3002<\/p>\n<p>\u3057\u304b\u3057\u3001\u4f7f\u3063\u3066\u307f\u305f\u7d50\u679c\u3001\uff08\u3068\u3066\u3082\u6b8b\u5ff5\u306a\u306e\u3067\u3059\u304c\uff09\u4e0a\u65b9\u5411\u306e\u30c4\u30fc\u30eb\u30c1\u30c3\u30d7\u3060\u3051\u3046\u307e\u304f\u8868\u793a\u3067\u304d\u306a\u3044\u72b6\u614b\u3060\u3063\u305f\u306e\u3067\u3001\u6025\u907d<code>Bootstrap 4<\/code>\u3092\u4f7f\u3046\u3053\u3068\u306b\u3057\u307e\u3057\u305f\u3002\uff08<code>4<\/code>\u3067\u306f\u554f\u984c\u306a\u304b\u3063\u305f\u306e\u3067\u3001\u300c\u3046\u30fc\u3093\u3001\u306a\u305c\u3060\u308d\u3046\ud83d\ude25\u300d\u3068\u3044\u3046\u611f\u3058\u3067\u3059\uff09<\/p>\n<p>\u3061\u306a\u307f\u306b\u3001<code>Bootstrap 5<\/code>\u306f<code>jQuery<\/code>\u4f9d\u5b58\u304c\u306a\u304f\u306a\u3063\u305f\u7d50\u679c\u3001\u5c11\u3057\u66f8\u304d\u65b9\u306b\u30af\u30bb\u304c\u3067\u3066\u304d\u305f\u306a\u3068\u3044\u3046\u5370\u8c61\u3067\u3057\u305f\u3002<\/p>\n<p>\u3068\u306f\u3044\u3048\u3001\u30c6\u30b9\u30c8\u7684\u306b\u3064\u304f\u308b\u5834\u5408\u306f\u307e\u3060\u307e\u3060<code>TailwindCSS<\/code>\u3088\u308a<code>Bootstrap<\/code>\u304c\u697d\u306a\u306e\u3067\u3001\u4eca\u5f8c\u306b\u671f\u5f85\u3057\u305f\u3044\u3068\u3053\u308d\u3067\u3059\ud83d\udc4d<\/p>\n<p>\u305c\u3072\u3001\u7686\u3055\u3093\u3082<code>Bootstrap 5<\/code>\u3082\u542b\u3081\u3066\u30c1\u30e3\u30ec\u30f3\u30b8\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u306d\u3002<\/p>\n<p>\u3067\u306f\u3067\u306f\u301c\u2757<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-6069 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/03\/no_20.png\" alt=\"\" width=\"326\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/03\/no_20.png 326w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2020\/03\/no_20-300x294.png 300w\" sizes=\"auto, (max-width: 326px) 100vw, 326px\" \/>\u300c\u30ab\u30ca\u30c0\u3067\u77e5\u3063\u305f<br \/>\n\u30d2\u30de\u30ef\u30ea\u306e\u7a2e\u30b9\u30ca\u30c3\u30af<br \/>\n\u65e5\u672c\u3067\u8cb7\u3048\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u307e\u3057\u305f\ud83d\udc4d\u300d<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u3053\u306e\u9593\u5730\u5143\u30cb\u30e5\u30fc\u30b9\u3067\u3042\u308b\u30b8\u30e0\u304c\u9589\u5e97\u3059\u308b\u3068\u3044\u3046\u8a71\u3092\u77e5\u308a\u307e\u3057\u305f\u3002\u5b9f\u306f\u3053\u306e\u30b8\u30e0\u306e\u4e88\u7d04\u30b7\u30b9\u30c6\u30e0\u958b\u767a\u306b\u53c2\u52a0\u3057\u305f\u3053\u3068\u304c\u3042\u308b\u306e\u3067\u3001\u5c11\u3057\u5bc2\u3057\u3044\u6c17\u6301\u3061\u306b\u306a\u308a\u307e\u3057\u305f\u3002 \u3068 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.capilano-fw.com\/?p=9269\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;Laravel \u3067\u300c\u6642\u9593\u67a0\u300d\u304c\u8a2d\u5b9a\u3067\u304d\u308b\u90e8\u5c4b\u4e88\u7d04\u30b7\u30b9\u30c6\u30e0\u3092\u3064\u304f\u308b&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":9288,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-9269","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\/9269","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=9269"}],"version-history":[{"count":11,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/9269\/revisions"}],"predecessor-version":[{"id":9291,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/9269\/revisions\/9291"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/media\/9288"}],"wp:attachment":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9269"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9269"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9269"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}