{"id":11911,"date":"2023-09-03T07:00:19","date_gmt":"2023-09-02T22:00:19","guid":{"rendered":"https:\/\/blog.capilano-fw.com\/?p=11911"},"modified":"2023-08-11T05:13:33","modified_gmt":"2023-08-10T20:13:33","slug":"nativephp-%e3%81%a7%e7%b0%a1%e5%8d%98%e3%81%aa%e3%83%a1%e3%83%a2%e5%b8%b3%e3%82%a2%e3%83%97%e3%83%aa%e3%81%a4%e3%81%8f%e3%81%a3%e3%81%a6%e3%81%bf%e3%81%9f","status":"publish","type":"post","link":"https:\/\/blog.capilano-fw.com\/?p=11911","title":{"rendered":"NativePHP \u3067\u7c21\u5358\u306a\u30e1\u30e2\u5e33\u30a2\u30d7\u30ea\u3064\u304f\u3063\u3066\u307f\u305f"},"content":{"rendered":"<p><strong style=\"font-size: 35px;\">\u3010\u7686\u3055\u3093\u3078\u306e\u304a\u793c\uff1a500\u8a18\u4e8b\u9054\u6210\u3057\u307e\u3057\u305f\u2757\u3011<\/strong><\/p>\n<p>\u4eca\u56de\u306e\u8a18\u4e8b\u3067\u306a\u3093\u3068<code>500<\/code>\u8a18\u4e8b\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u524d\u56de\u306e<code>400<\/code>\u8a18\u4e8b\u304c\u300c2021\u5e7410\u670818\u65e5\u516c\u958b\u300d\u3060\u3063\u305f\u306e\u3067\u30011\u5e749\u30f6\u6708\u307b\u3069\u3067<code>100<\/code>\u8a18\u4e8b\u3092\u66f8\u304d\u307e\u3057\u305f\u3002<\/p>\n<p>\u3072\u3068\u3048\u306b\u7686\u3055\u3093\u304c\u8a2a\u554f\u3057\u3066\u304f\u3060\u3055\u308b\u3053\u3068\u304c\u30e2\u30c1\u30d9\u30fc\u30b7\u30e7\u30f3\u306b\u3064\u306a\u304c\u308a\u307e\u3057\u305f\u3002<br \/>\n\u4eca\u5f8c\u3068\u3082<code>Console dot Log<\/code>\u3092\u3088\u308d\u3057\u304f\u304a\u9858\u3044\u3044\u305f\u3057\u307e\u3059\u3002m(_ _)m<\/p>\n<p>\u203b \u3061\u306a\u307f\u306b\u4e00\u756a\u6700\u521d\u306e\u6280\u8853\u8a18\u4e8b\uff08\u7b2c\uff12\u56de\u76ee\u306e\u8a18\u4e8b\uff09\u306f<code>Larvel 5.4<\/code>\u3092\u4f7f\u3063\u3066\u307e\u3057\u305f\u3002\u6642\u9593\u304c\u7d4c\u3064\u306e\u306f\u65e9\u3044\u3067\u3059\u306d\u2026<\/p>\n<p>\u3067\u306f\u3001\u3053\u3053\u304b\u3089\u306f\u672c\u984c\u3067\u3059\u3002<\/p>\n<p>\u3053\u306e\u9593\u60c5\u5831\u306e\u5b9d\u5eab\u3001X\uff08\u65e7\u30c4\u30a4\u30c3\u30bf\u30fc\uff09\u3092\u898b\u3066\u3044\u308b\u3068\u3001\u3042\u308b\u9762\u767d\u305d\u3046\u306a\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u304c\u7d39\u4ecb\u3055\u308c\u3066\u3044\u307e\u3057\u305f\u3002<\/p>\n<p>\u305d\u308c\u304c\u30fb\u30fb\u30fb\u30fb\u30fb\u30fb<\/p>\n<p><strong style=\"font-size: 35px;\">PHP\u3067\u30c7\u30b9\u30af\u30c8\u30c3\u30d7\u30fb\u30a2\u30d7\u30ea\u304c\u4f5c\u6210\u3067\u304d\u308b\u300cNativePHP\u300d<\/strong><\/p>\n<p>\u3067\u3059\u3002<\/p>\n<p>\u305d\u3053\u3067\u2757<br \/>\n\u4eca\u56de\u306f<code>NativePHP<\/code>\u3092\u4f7f\u3063\u3066\u7c21\u5358\u306a\u30e1\u30e2\u5e33\u30a2\u30d7\u30ea\u3092\u4f5c\u3063\u3066\u307f\u308b\u3053\u3068\u306b\u3057\u307e\u3057\u305f\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><strong>\u26a0 \u3054\u6ce8\u610f\uff1a<\/strong> <code>2023.08.10<\/code>\u73fe\u5728\u3001<code>NativePHP<\/code>\u306f\u30a2\u30eb\u30d5\u30a1\u7248\u3067\u3059\u3002\u4eca\u5f8c\u5909\u66f4\u304c\u52a0\u3048\u3089\u308c\u308b\u3068\u601d\u3044\u307e\u3059\u306e\u3067\u3001\u304a\u6c17\u3092\u3064\u3051\u304f\u3060\u3055\u3044\u3002<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4445 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/no_2.png\" alt=\"\" width=\"370\" height=\"310\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/no_2.png 370w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/no_2-300x251.png 300w\" sizes=\"auto, (max-width: 370px) 100vw, 370px\" \/>\u300c500\u8a18\u4e8b\u3082\u66f8\u304f\u3068\u601d\u3063\u3066\u306a\u304b\u3063\u305f\u3067\u3059<br \/>\n\u30db\u30f3\u30c8\u306b\u7686\u3055\u3093<br \/>\n\u3042\u308a\u304c\u3068\u3046 \ud83c\udf89\u300d<\/p>\n<p><strong>\u958b\u767a\u74b0\u5883\uff1a<\/strong> Laravel 10.x\u3001PHP 8.1<\/p>\n<h1>NativePHP \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b<\/h1>\n<p>\u3067\u306f\u3001\u307e\u305a\u306f<code>NativePHP<\/code>\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<br \/>\n\u306a\u304a\u3001\u5fc5\u8981\u306a\u74b0\u5883\u306f\u4ee5\u4e0b\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<ul>\n<li>PHP 8.1<\/li>\n<li>Laravel 10 \u4ee5\u4e0a<\/li>\n<li>NPM<\/li>\n<li>Linux or MacOS<\/li>\n<\/ul>\n<p><strong>\ud83d\udcdd \u53c2\u8003\u30da\u30fc\u30b8\uff1a<\/strong>\u00a0<a href=\"https:\/\/nativephp.com\/docs\/1\/getting-started\/installation\" target=\"_blank\" rel=\"noopener\">Installation &#8211; NativePHP<\/a><\/p>\n<p>\u3061\u306a\u307f\u306b\u3001\u3053\u3053\u306b\u306f<code>windows<\/code>\u304c\u5165\u3063\u3066\u3044\u306a\u3044\u306e\u3067\u3059\u304c\u3001\u4ee5\u4e0b\u306e\u30d3\u30eb\u30c9\u306b\u95a2\u3059\u308b\u30da\u30fc\u30b8\u3067\u306f\u3001\u300c<strong>mac<\/strong>\u300d\u300c<strong>windows<\/strong>\u300d\u300c<strong>linux<\/strong>\u300d\u3068\u66f8\u3044\u3066\u3042\u308a\u307e\u3059\u3002\uff08\u306a\u306e\u3067\u30d3\u30eb\u30c9\u306f\u3069\u308c\u3067\u3082<code>OK<\/code>\u306a\u3088\u3046\u3067\u3059\uff09<\/p>\n<p><strong>\ud83d\udcdd \u53c2\u8003\u30da\u30fc\u30b8\uff1a<\/strong>\u00a0<a href=\"https:\/\/nativephp.com\/docs\/1\/publishing\/building\" target=\"_blank\" rel=\"noopener\">Building &#8211; NativePHP<\/a><\/p>\n<p>\u307e\u305f\u3001\u4ee5\u4e0b\u306e\u30da\u30fc\u30b8\u306b\u3088\u308b\u3068<code>windows<\/code>\u306e\u30b5\u30dd\u30fc\u30c8\u3082\u306a\u3093\u3068\u304b\u6539\u9020\u3059\u308c\u3070\u3044\u3051\u308b\u3088\u3046\u3067\u3059\u3057\u3001<code>windows<\/code>\u5411\u3051\u306f\u958b\u767a\u4e2d\u3068\u306e\u3053\u3068\u306a\u306e\u3067\u4eca\u306e\u3068\u3053\u308d\u3001\u300c<strong>\u958b\u767a\u306f mac \u3068 linux \u3060\u3051\u306d\u3002\u3067\u3082\u30d3\u30eb\u30c9\u306f\u5168\u90e8\u3044\u3051\u308b\u3088<\/strong>\u300d\u3068\u3044\u3046\u3053\u3068\u306a\u306e\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002<\/p>\n<p><strong>\ud83d\udcdd \u53c2\u8003\u30da\u30fc\u30b8\uff1a\u00a0<\/strong><a href=\"https:\/\/gist.github.com\/ShaneShipston\/8bb7cabc423cf0cc64da0eacafa53171\" target=\"_blank\" rel=\"noopener\">NativePHP for Windows<\/a><\/p>\n<h1>Laravel \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b<\/h1>\n<p>\u300c<strong>NativePHP \u306a\u306e\u306b Laravel\uff01\uff1f<\/strong>\u300d\u3068\u601d\u308f\u308c\u305f\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u304c\u3001<code>NativePHP<\/code>\u306f<code>Laravel<\/code>\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u3068\u3057\u3066\u63d0\u4f9b\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u4eca\u56de\u306f\u5c02\u7528\u306b<code>Laravel 10.x<\/code>\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3001\u305d\u3053\u306b\u74b0\u5883\u3092\u3064\u304f\u3063\u3066\u3044\u304f\u3053\u3068\u306b\u3057\u307e\u3059\u3002<\/p>\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>composer create-project laravel\/laravel native_php<\/strong><\/pre>\n<p>\u203b \u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u540d\u306f<code>native_php<\/code>\u306b\u3057\u3066\u3044\u307e\u3059\u304c\u304a\u597d\u307f\u3067\u5909\u66f4\u3057\u3066\u304f\u3060\u3055\u3044<\/p>\n<h1>NativePHP \u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b<\/h1>\n<p>\u7d9a\u3044\u3066\u3001<code>NativePHP<\/code>\u306e\u672c\u4f53\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067\u30d5\u30a9\u30eb\u30c0\u5185\u3078\u79fb\u52d5\u3057\u3001\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>cd native_php<\/strong>\r\n<strong>composer require nativephp\/electron<\/strong><\/pre>\n<p>\u3053\u308c\u3067<code>NativePHP<\/code>\u672c\u4f53\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u307e\u3057\u305f\uff01<\/p>\n<h1>\u30a4\u30f3\u30b9\u30c8\u30fc\u30e9\u30fc\u3092\u5b9f\u884c\u3059\u308b<\/h1>\n<p>\u6b21\u306b\u3001<code>NativePHP<\/code>\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30e9\u30fc\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<br \/>\n\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>php artisan native:install\r\n<\/strong><\/pre>\n<p>\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u8868\u793a\u306b\u306a\u308a\u307e\u3059\u306e\u3067\u3001<code>Yes<\/code>\u3092\u9078\u629e\u3057<code>Enter<\/code>\u30ad\u30fc\u3092\u62bc\u3057\u307e\u3059\u3002\uff08<code>npm<\/code>\u30d1\u30c3\u30b1\u30fc\u30b8\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\uff1f\u3068\u805e\u3044\u3066\u3044\u307e\u3059\uff09<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11913\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2023\/08\/native_php_1.png\" alt=\"\" width=\"595\" height=\"142\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2023\/08\/native_php_1.png 595w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2023\/08\/native_php_1-300x72.png 300w\" sizes=\"auto, (max-width: 595px) 100vw, 595px\" \/><\/p>\n<p>\u3059\u308b\u3068\u3001\uff08\u5c11\u3057\u6642\u9593\u304c\u304b\u304b\u308b\u304b\u3082\u3067\u3059\u304c\uff09<code>npm<\/code>\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u304c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u305d\u3057\u3066\u3001\u6700\u5f8c\u306b\u300c<strong>NativePHP \u306e\u958b\u767a\u30b5\u30fc\u30d0\u30fc\u8d77\u52d5\u3059\u308b\uff1f\uff1f<\/strong>\u300d\u3068\u805e\u3044\u3066\u304f\u308b\u306e\u3067\u3053\u308c\u3082\u300c<strong>Yes<\/strong>\u300d\u306b\u3057\u3066<code>Enter<\/code>\u30ad\u30fc\u3092\u62bc\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11915\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2023\/08\/native_php_2.png\" alt=\"\" width=\"595\" height=\"88\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2023\/08\/native_php_2.png 595w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2023\/08\/native_php_2-300x44.png 300w\" sizes=\"auto, (max-width: 595px) 100vw, 595px\" \/><\/p>\n<p>\u3059\u308b\u3068\u3001\u3053\u308c\u3060\u3051\u3067\u4ee5\u4e0b\u306e\u30a6\u30a3\u30f3\u30c9\u30a6\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002\uff08\u30b9\u30b4\u30a4\u3067\u3059\u306d\uff01\uff09<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11916\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2023\/08\/native_php_3.png\" alt=\"\" width=\"640\" height=\"478\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2023\/08\/native_php_3.png 640w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2023\/08\/native_php_3-300x224.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>\u203b \u306a\u304a\u3001\u30b3\u30de\u30f3\u30c9\u3067\u8d77\u52d5\u3059\u308b\u5834\u5408\u306f\u4ee5\u4e0b\u3092\u4f7f\u3063\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>php artisan native:serve<\/strong><\/pre>\n<h1>SQLite \u304c\u3064\u304b\u3048\u308b\u3088\u3046\u306b\u3059\u308b<\/h1>\n<p>\u4eca\u56de\u306f\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb\u3067<code>DB<\/code>\u6a5f\u80fd\u3092\u6301\u305f\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u308b<code>SQLite<\/code>\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u304a\u3044\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u306a\u304a\u3001\u4ee5\u4e0b\u306f<code>Ubuntu 22.04<\/code>\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u65b9\u6cd5\u3067\u3059\u3002\uff08\u30ec\u30a2\u30b1\u30fc\u30b9\u3067\u30b4\u30e1\u30f3\u30ca\u30b5\u30a4\ud83d\ude02\uff09<\/p>\n<p>\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<pre><strong>sudo apt update\r\nsudo apt upgrade\r\nsudo apt install sqlite3\r\nsudo apt install php8.1-sqlite3\r\nsudo systemctl restart nginx<\/strong><\/pre>\n<p>\u203b \u306a\u304a\u3001\u4eca\u56de\u306f<code>php 8.1<\/code>\uff06<code>nginx<\/code>\u3092\u4f7f\u3063\u3066\u3044\u307e\u3059\u304c\u3054\u81ea\u8eab\u306e\u74b0\u5883\u306b\u5408\u308f\u305b\u3066\u9069\u5b9c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u5909\u66f4\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h1>\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u8a2d\u5b9a\u3092\u3059\u308b<\/h1>\n<p><code>.env<\/code>\u5185\u306e<code>DB_CONNECTION<\/code>\u3092<code>sqlite<\/code>\u3078\u5909\u66f4\u3057\u3001\u3055\u3089\u306b<code>DB_DATABASE<\/code>\u306f\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\u3057\u3066\u304f\u3060\u3055\u3044\u3002\uff08\u521d\u671f\u5024\u306e\u30d5\u30a1\u30a4\u30eb\u30d1\u30b9\u3092\u4f7f\u3046\u3088\u3046\u306b\u3057\u307e\u3059\uff09<\/p>\n<p><strong>.env<\/strong><\/p>\n<div>\n<pre>DB_CONNECTION=<strong>sqlite<\/strong>\r\nDB_HOST=127.0.0.1\r\nDB_PORT=3306\r\n<strong>#DB_DATABASE=laravel<\/strong>\r\nDB_USERNAME=root\r\nDB_PASSWORD=<\/pre>\n<\/div>\n<p>\u307e\u305f\u3001\u30b3\u30f3\u30d5\u30a3\u30b0\u306e\u4e2d\u306e<code>sqlite<\/code>\u90e8\u5206\u306e\u53c2\u7167\u30d5\u30a1\u30a4\u30eb\u3092<code>nativephp.sqlite<\/code>\u3078\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n<p><strong>config\/database.php<\/strong><\/p>\n<div>\n<pre>\/\/ \u7701\u7565\r\n\r\n'sqlite' =&gt; [\r\n    'driver' =&gt; 'sqlite',\r\n    'url' =&gt; env('DATABASE_URL'),\r\n    <strong>'database' =&gt; env('DB_DATABASE', database_path('nativephp.sqlite')), \/\/ database.sqlite \u304b\u3089\u5909\u66f4\u3057\u307e\u3057\u305f<\/strong>\r\n    'prefix' =&gt; '',\r\n    'foreign_key_constraints' =&gt; env('DB_FOREIGN_KEYS', true),\r\n],\r\n\r\n\/\/ \u7701\u7565<\/pre>\n<h1>\u30a6\u30a3\u30f3\u30c9\u30a6\u30b5\u30a4\u30ba\u3092\u6307\u5b9a\u3059\u308b<\/h1>\n<p><code>NativePHP<\/code>\u306f\u8d77\u52d5\u6642\u306e\u30a6\u30a3\u30f3\u30c9\u30a6\u30b5\u30a4\u30ba\u3092\u5909\u66f4\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br \/>\n\u305b\u3063\u304b\u304f\u306a\u306e\u3067\u3001\u5909\u66f4\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><strong>app\/Providers\/NativeAppServiceProvider.php<\/strong><\/p>\n<pre>\/\/ \u7701\u7565\r\n\r\npublic function boot(): void\r\n{\r\n    Window::open()\r\n<strong>        -&gt;width(1200) \/\/ \ud83d\udc47 \u4ee5\u964d\u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f\r\n        -&gt;height(600);<\/strong>\r\n}\r\n\r\n\/\/ \u7701\u7565\r\n<\/pre>\n<\/div>\n<h1>\u5fc5\u8981\u306a\u30d5\u30a1\u30a4\u30eb\u3092\u3064\u304f\u308b<\/h1>\n<p>\u3067\u306f\u3001\u3053\u3053\u304b\u3089\u306f\u901a\u5e38\u306e<code>Laravel<\/code>\u3068\u540c\u3058\u4f5c\u696d\u3067\u3001\u30e1\u30e2\u5e33\u306e\u6a5f\u80fd\u3092\u30d7\u30ed\u30b0\u30e9\u30e0\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p>\u307e\u305a\u306f\u5fc5\u8981\u306a\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<br \/>\n\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>php artisan make:model Memo -mcs\r\n<\/strong><\/pre>\n<p>\u3053\u308c\u3067\u3001\u300c<strong>\u30e2\u30c7\u30eb<\/strong>\u300d\u300c<strong>\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3<\/strong>\u300d\u300c<strong>\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc<\/strong>\u300d\u300c<strong>Seeder<\/strong>\u300d\u306e\uff14\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n<p>\u3053\u308c\u3089\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u5909\u66f4\u3057\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<h1>\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\u5909\u66f4\u3059\u308b<\/h1>\n<p>\u307e\u305a\u306f\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3067\u3059\u3002<br \/>\n\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5909\u66f4\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><strong>app\/Http\/Controllers\/MemoController.php<\/strong><\/p>\n<pre><strong>&lt;?php\r\n\r\nnamespace App\\Http\\Controllers;\r\n\r\nuse App\\Models\\Memo;\r\nuse Illuminate\\Http\\Request;\r\n\r\nclass MemoController extends Controller\r\n{\r\n    public function index()\r\n    {\r\n        return view('memo.index');\r\n    }\r\n\r\n    public function list()\r\n    {\r\n        return Memo::query()\r\n            -&gt;orderBy('id', 'desc')\r\n            -&gt;get();\r\n    }\r\n\r\n    public function save(Request $request)\r\n    {\r\n        \/\/ \u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u306f\u7701\u7565\u3057\u3066\u3044\u307e\u3059\r\n\r\n        $memo = Memo::findOrNew($request-&gt;id);\r\n        $memo-&gt;title = $request-&gt;title;\r\n        $memo-&gt;body = $request-&gt;body;\r\n        $result = $memo-&gt;save();\r\n\r\n        return ['result' =&gt; $result];\r\n    }\r\n\r\n    public function destroy(Memo $memo)\r\n    {\r\n        \/\/ \u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u306f\u7701\u7565\u3057\u3066\u3044\u307e\u3059\r\n        $result = $memo-&gt;delete();\r\n\r\n        return ['result' =&gt; $result];\r\n    }\r\n} <\/strong><\/pre>\n<p>\u5185\u5bb9\u3068\u3057\u3066\u306f\u3001\u57fa\u672c\u7684\u306a\u3082\u306e\u3070\u304b\u308a\u3067\u3059\u306e\u3067\u30b7\u30f3\u30d7\u30eb\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<h1>Seeder \u30d5\u30a1\u30a4\u30eb\u3092\u5909\u66f4\u3059\u308b<\/h1>\n<p>\u7d9a\u3044\u3066\u3001\u30c6\u30b9\u30c8\u30c7\u30fc\u30bf\u3092\u81ea\u52d5\u3067\u4f5c\u6210\u3059\u308b\u305f\u3081\u306e\u30d5\u30a1\u30a4\u30eb<code>Seeder<\/code>\u3067\u3059\u3002<\/p>\n<p><strong>database\/seeders\/MemoSeeder.php<\/strong><\/p>\n<pre>\/\/ \u7701\u7565\r\n\r\n<strong>public function run(): void\r\n{\r\n    for($i = 1; $i &lt;= 10; $i++) {\r\n\r\n        $memo = new \\App\\Models\\Memo();\r\n        $memo-&gt;title = '\u30bf\u30a4\u30c8\u30eb' . $i;\r\n        $memo-&gt;body = \"\u30c6\u30b9\u30c8\u5185\u5bb9\\n\u30c6\u30b9\u30c8\u5185\u5bb9\\n\u30c6\u30b9\u30c8\u5185\u5bb9\" . $i;\r\n        $memo-&gt;save();\r\n\r\n    }\r\n}<\/strong>\r\n\r\n\/\/ \u7701\u7565\r\n<\/pre>\n<p><code>Seeder<\/code>\u306f\u4f5c\u6210\u3057\u305f\u3060\u3051\u3067\u306f\u6709\u52b9\u306b\u306a\u308a\u307e\u305b\u3093\u306e\u3067\u3001<code>Laravel<\/code>\u5074\u3078\u30bb\u30c3\u30c8\u3057\u307e\u3059\u3002<\/p>\n<pre>\/\/ \u7701\u7565\r\n\r\n<strong>public function run(): void\r\n{\r\n    $this-&gt;call([\r\n        MemoSeeder::class, \/\/ \ud83d\udc48 \u3053\u3053\u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f\r\n    ]);\r\n}<\/strong>\r\n\r\n\/\/ \u7701\u7565\r\n<\/pre>\n<p><span style=\"font-size: 1rem;\">\u3067\u306f\u3001\u3053\u306e\u72b6\u614b\u3067<code>DB<\/code>\uff08<code>SQLite<\/code>\uff09\u3092\u521d\u671f\u5316\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<br \/>\n<\/span>\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>php artisan migrate:fresh --seed\r\n<\/strong><\/pre>\n<p>\u3059\u308b\u3068\u3001 \u5b9f\u969b\u306e\u30c6\u30fc\u30d6\u30eb\u306f\u3053\u3046\u306a\u308a\u307e\u3057\u305f\u3002\uff08<code>FireFox<\/code>\u306e\u30a2\u30c9\u30aa\u30f3\u3067\u8868\u793a\u3057\u3066\u307e\u3059\uff09<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11918\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2023\/08\/native_php_4.png\" alt=\"\" width=\"622\" height=\"325\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2023\/08\/native_php_4.png 622w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2023\/08\/native_php_4-300x157.png 300w\" sizes=\"auto, (max-width: 622px) 100vw, 622px\" \/><\/p>\n<h1>\u30d3\u30e5\u30fc\u3092\u3064\u304f\u308b<\/h1>\n<p>\u6b21\u306b\u30d3\u30e5\u30fc\u3092\u4f5c\u308a\u307e\u3059\u3002<br \/>\n\u4eca\u56de\u5fc5\u8981\u306b\u306a\u308b\u306e\u306f\u3001\u4ee5\u4e0b\u306e\uff12\u3064\u3067\u3059\u3002<\/p>\n<ul>\n<li>\u30ec\u30a4\u30a2\u30a6\u30c8<\/li>\n<li>\u30e1\u30e2\u5e33\u7ba1\u7406\u30da\u30fc\u30b8<\/li>\n<\/ul>\n<p>\u3067\u306f\u3001\u307e\u305a\u306f\u30ec\u30a4\u30a2\u30a6\u30c8\u3067\u3059\u3002<br \/>\n\u4eca\u56de\u306f\u300c<strong>TailwindCSS<\/strong>\u300d\u300c<strong>Alpine.js<\/strong>\u300d\u300c<strong>Axios<\/strong>\u300d\u3092<code>CDN<\/code>\u3067\u547c\u3073\u51fa\u3057\u3066\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<p><strong>resources\/views\/layouts\/app.blade.php<\/strong><\/p>\n<div>\n<pre><strong>&lt;html&gt;<\/strong>\r\n<strong>&lt;head&gt;<\/strong>\r\n<strong>    &lt;title&gt;NativePHP \u306e\u30e1\u30e2\u5e33&lt;\/title&gt;<\/strong>\r\n<strong>    &lt;script src=\"https:\/\/cdn.tailwindcss.com\/3.3.3\"&gt;&lt;\/script&gt;<\/strong>\r\n<strong>    &lt;script defer src=\"https:\/\/cdn.jsdelivr.net\/npm\/alpinejs@3.x.x\/dist\/cdn.min.js\"&gt;&lt;\/script&gt;<\/strong>\r\n<strong>    &lt;script src=\"https:\/\/unpkg.com\/axios\/dist\/axios.min.js\"&gt;&lt;\/script&gt;<\/strong>\r\n<strong>&lt;\/head&gt;<\/strong>\r\n<strong>&lt;body&gt;<\/strong>\r\n<strong>    &lt;div class=\"p-5\"&gt;<\/strong>\r\n<strong>        @yield('content')<\/strong>\r\n<strong>    &lt;\/div&gt;<\/strong>\r\n<strong>    @yield('script')<\/strong>\r\n<strong>&lt;\/body&gt;<\/strong>\r\n<strong>&lt;\/html&gt;<\/strong><\/pre>\n<p>\u305d\u3057\u3066\u3001\u30e1\u30e2\u5e33\u306e\u90e8\u5206\u3067\u3059\u3002<\/p>\n<p><strong>resources\/views\/memo\/index.blade.php<\/strong><\/p>\n<div>\n<pre><strong>@extends('layouts.app')<\/strong>\r\n\r\n<strong>@section('content')<\/strong>\r\n\r\n<strong>    &lt;div x-data=\"memoData\"&gt;<\/strong>\r\n\r\n<strong>        &lt;!-- index \u30e2\u30fc\u30c9 --&gt;<\/strong>\r\n<strong>        &lt;template x-if=\"isModeIndex\"&gt;<\/strong>\r\n<strong>            &lt;div&gt;<\/strong>\r\n<strong>                &lt;div class=\"mb-5\"&gt;<\/strong>\r\n<strong>                    &lt;button class=\"bg-blue-500 hover:bg-blue-700 text-white font-bold py-1 px-3 rounded\" @click=\"onCreate\"&gt;<\/strong>\r\n<strong>                        \u30e1\u30e2\u3092\u8ffd\u52a0\u3059\u308b<\/strong>\r\n<strong>                    &lt;\/button&gt;<\/strong>\r\n<strong>                &lt;\/div&gt;<\/strong>\r\n<strong>                &lt;div class=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4\"&gt;<\/strong>\r\n<strong>                    &lt;template x-for=\"memo in memos\"&gt;<\/strong>\r\n<strong>                        &lt;div class=\"relative max-w-xs w-full h-auto border-2 bg-gray-50 shadow-lg rounded-lg overflow-hidden\"&gt;<\/strong>\r\n<strong>                           &lt;div class=\"px-4 py-2\"&gt;<\/strong>\r\n<strong>                                &lt;h1 class=\"font-bold mb-2 truncate\" x-text=\"memo.title\"&gt;&lt;\/h1&gt;<\/strong>\r\n<strong>                                &lt;p class=\"text-gray-700 text-base mb-5 whitespace-pre-wrap\" x-text=\"memo.body\"&gt;&lt;\/p&gt;<\/strong>\r\n<strong>                            &lt;\/div&gt;<\/strong>\r\n<strong>                            &lt;div class=\"absolute bottom-2 right-4 space-x-2\"&gt;<\/strong>\r\n<strong>                                &lt;a href=\"#\" class=\"text-blue-500 hover:text-blue-700 text-sm\" @click.prevent=\"onEdit(memo)\"&gt;\u5909\u66f4&lt;\/a&gt;<\/strong>\r\n<strong>                                &lt;a href=\"#\" class=\"text-red-500 hover:text-red-700 text-sm\" @click=\"onDelete(memo)\"&gt;\u524a\u9664&lt;\/a&gt;<\/strong>\r\n<strong>                            &lt;\/div&gt;<\/strong>\r\n<strong>                        &lt;\/div&gt;<\/strong>\r\n<strong>                    &lt;\/template&gt;<\/strong>\r\n<strong>                &lt;\/div&gt;<\/strong>\r\n<strong>            &lt;\/div&gt;<\/strong>\r\n<strong>        &lt;\/template&gt;<\/strong>\r\n\r\n<strong>        &lt;!-- form \u30e2\u30fc\u30c9 --&gt;<\/strong>\r\n<strong>        &lt;template x-if=\"isModeForm\"&gt;<\/strong>\r\n<strong>            &lt;div&gt;<\/strong>\r\n<strong>                &lt;div class=\"mb-5\"&gt;<\/strong>\r\n<strong>                    &lt;button class=\"bg-blue-500 hover:bg-blue-700 text-white font-bold py-1 px-3 rounded\" @click=\"setMode('index')\"&gt;<\/strong>\r\n<strong>                        \u623b\u308b<\/strong>\r\n<strong>                    &lt;\/button&gt;<\/strong>\r\n<strong>                &lt;\/div&gt;<\/strong>\r\n<strong>                &lt;div class=\"w-full max-w-xl mx-auto mt-10\"&gt;<\/strong>\r\n<strong>                    &lt;!-- Title Input --&gt;<\/strong>\r\n<strong>                    &lt;div class=\"mb-6\"&gt;<\/strong>\r\n<strong>                        &lt;label for=\"title\" class=\"block text-gray-700 text-sm font-bold mb-2\"&gt;\u30bf\u30a4\u30c8\u30eb:&lt;\/label&gt;<\/strong>\r\n<strong>                        &lt;input<\/strong>\r\n<strong>                            id=\"title\"<\/strong>\r\n<strong>                            type=\"text\"<\/strong>\r\n<strong>                            name=\"title\"<\/strong>\r\n<strong>                            class=\"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline\"<\/strong>\r\n<strong>                            x-model=\"params.title\"&gt;<\/strong>\r\n<strong>                    &lt;\/div&gt;<\/strong>\r\n\r\n<strong>                    &lt;!-- Body Textarea --&gt;<\/strong>\r\n<strong>                    &lt;div class=\"mb-6\"&gt;<\/strong>\r\n<strong>                        &lt;label for=\"body\" class=\"block text-gray-700 text-sm font-bold mb-2\"&gt;\u672c\u6587:&lt;\/label&gt;<\/strong>\r\n<strong>                        &lt;textarea<\/strong>\r\n<strong>                            id=\"body\"<\/strong>\r\n<strong>                            name=\"body\"<\/strong>\r\n<strong>                            rows=\"5\"<\/strong>\r\n<strong>                            class=\"shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline\"<\/strong>\r\n<strong>                            x-model=\"params.body\"&gt;&lt;\/textarea&gt;<\/strong>\r\n<strong>                    &lt;\/div&gt;<\/strong>\r\n\r\n<strong>                    &lt;div class=\"flex items-center justify-between\"&gt;<\/strong>\r\n<strong>                        &lt;button<\/strong>\r\n<strong>                            class=\"bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline\"<\/strong>\r\n<strong>                            type=\"button\"<\/strong>\r\n<strong>                            @click=\"onSave\"&gt;<\/strong>\r\n<strong>                            \u9001\u4fe1<\/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;\/template&gt;<\/strong>\r\n\r\n<strong>    &lt;\/div&gt;<\/strong>\r\n\r\n<strong>@endsection<\/strong>\r\n\r\n<strong>@section('script')<\/strong>\r\n\r\n<strong>    &lt;script&gt;<\/strong>\r\n\r\n<strong>        const memoData = {<\/strong>\r\n\r\n<strong>            mode: 'index', \/\/ or `form`<\/strong>\r\n<strong>            setMode(mode) {<\/strong>\r\n\r\n<strong>                this.mode = mode;<\/strong>\r\n\r\n<strong>                if(mode === 'form') {<\/strong>\r\n\r\n<strong>                    this.$nextTick(() =&gt; {<\/strong>\r\n\r\n<strong>                        document.getElementById('title').focus();<\/strong>\r\n\r\n<strong>                    });<\/strong>\r\n\r\n<strong>                }<\/strong>\r\n\r\n<strong>            },<\/strong>\r\n<strong>            isModeIndex() {<\/strong>\r\n\r\n<strong>                return this.mode === 'index';<\/strong>\r\n\r\n<strong>            },<\/strong>\r\n<strong>            isModeForm() {<\/strong>\r\n\r\n<strong>                return this.mode === 'form'<\/strong>\r\n\r\n<strong>            },<\/strong>\r\n\r\n<strong>            \/\/ Index<\/strong>\r\n<strong>            params: {},<\/strong>\r\n<strong>            onCreate() {<\/strong>\r\n\r\n<strong>                this.params = {<\/strong>\r\n<strong>                    title: '',<\/strong>\r\n<strong>                    body: '',<\/strong>\r\n<strong>                };<\/strong>\r\n<strong>                this.setMode('form');<\/strong>\r\n\r\n<strong>            },<\/strong>\r\n<strong>            onEdit(memo) {<\/strong>\r\n\r\n<strong>                this.params = memo;<\/strong>\r\n<strong>                this.setMode('form');<\/strong>\r\n\r\n<strong>            },<\/strong>\r\n\r\n<strong>            \/\/ Form<\/strong>\r\n<strong>            onSave() {<\/strong>\r\n\r\n<strong>                if(! confirm('\u9001\u4fe1\u3057\u307e\u3059\u3002\u3088\u308d\u3057\u3044\u3067\u3059\u304b\uff1f')) return;<\/strong>\r\n\r\n<strong>                const url = '{{ route('memo.save') }}';<\/strong>\r\n\r\n<strong>                axios.post(url, this.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.setMode('index');<\/strong>\r\n<strong>                            this.getMemos();<\/strong>\r\n\r\n<strong>                        }<\/strong>\r\n\r\n<strong>                    });<\/strong>\r\n\r\n<strong>            },<\/strong>\r\n\r\n<strong>            \/\/ Delete<\/strong>\r\n<strong>            onDelete(memo) {<\/strong>\r\n\r\n<strong>                if(! confirm('\u524a\u9664\u3057\u307e\u3059\u3002\u3088\u308d\u3057\u3044\u3067\u3059\u304b\uff1f')) return;<\/strong>\r\n\r\n<strong>                const url = '{{ route('memo.destroy', '') }}\/'+ memo.id;<\/strong>\r\n<strong>                const params = {<\/strong>\r\n<strong>                    _method: 'DELETE',<\/strong>\r\n<strong>                };<\/strong>\r\n\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.getMemos();<\/strong>\r\n\r\n<strong>                        }<\/strong>\r\n\r\n<strong>                    });<\/strong>\r\n\r\n<strong>            },<\/strong>\r\n\r\n<strong>            memos: [],<\/strong>\r\n<strong>            getMemos() {<\/strong>\r\n\r\n<strong>                const url = '{{ route('memo.list') }}';<\/strong>\r\n\r\n<strong>                axios.get(url)<\/strong>\r\n<strong>                    .then(response =&gt; {<\/strong>\r\n\r\n<strong>                        this.memos = response.data;<\/strong>\r\n\r\n<strong>                    })<\/strong>\r\n\r\n<strong>            },<\/strong>\r\n\r\n<strong>            init() {<\/strong>\r\n\r\n<strong>                this.getMemos();<\/strong>\r\n\r\n<strong>            }<\/strong>\r\n<strong>        };<\/strong>\r\n\r\n<strong>    &lt;\/script&gt;<\/strong>\r\n\r\n<strong>@endsection<\/strong><\/pre>\n<\/div>\n<p>\u3061\u3087\u3063\u3068\u30b3\u30fc\u30c9\u304c\u9577\u3044\u3067\u3059\u304c\u3001\u4e00\u89a7\u8868\u793a\u3068\u30d5\u30a9\u30fc\u30e0\u3092\u5207\u308a\u66ff\u3048\u3089\u308c\u308b\u3088\u3046\u306b\u3057\u3066\u4e00\u4f53\u578b\u306e\u30da\u30fc\u30b8\u306b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u30c7\u30fc\u30bf\u306e\u53d6\u5f97\u3084\u4fdd\u5b58\u3001\u524a\u9664\u306f<code>MemoController<\/code>\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h1>\u30eb\u30fc\u30c8\u3092\u3064\u304f\u308b<\/h1>\n<p>\u305d\u3057\u3066\u3001\u6700\u671f\u306b\u30eb\u30fc\u30c8\u3067\u3059\u3002<\/p>\n<div>\n<pre>&lt;?php\r\n\r\nuse Illuminate\\Support\\Facades\\Route;\r\n<strong>use App\\Http\\Controllers\\MemoController;<\/strong>\r\n\r\n<strong>Route::get('\/', function(){ return to_route('memo.index'); });<\/strong>\r\n<strong>Route::prefix('memo')-&gt;controller(MemoController::class)-&gt;group(function(){<\/strong>\r\n<strong>    Route::get('\/', [MemoController::class, 'index'])-&gt;name('memo.index');<\/strong>\r\n<strong>    Route::get('\/list', [MemoController::class, 'list'])-&gt;name('memo.list');<\/strong>\r\n<strong>    Route::post('\/save', [MemoController::class, 'save'])-&gt;name('memo.save');<\/strong>\r\n<strong>    Route::delete('\/delete\/{memo}', [MemoController::class, 'destroy'])-&gt;name('memo.destroy');<\/strong>\r\n<strong>});<\/strong><\/pre>\n<p>\u3061\u306a\u307f\u306b\u3001\u30c8\u30c3\u30d7\u30da\u30fc\u30b8\u306b\u30a2\u30af\u30bb\u30b9\u3057\u305f\u3068\u304d\uff08\u30c7\u30b9\u30af\u30c8\u30c3\u30d7\u30a2\u30d7\u30ea\u3092\u8d77\u52d5\u3057\u305f\u6642\u3001\u81ea\u52d5\u7684\u306b\u30e1\u30e2\u5e33\u306e<code>index<\/code>\u3078\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3059\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\uff09<\/p>\n<p>\u3053\u308c\u3067\u4f5c\u696d\u306f\u5b8c\u4e86\u3067\u3059\u3002<br \/>\n\u304a\u75b2\u308c\u69d8\u3067\u3057\u305f\ud83d\ude0a\u2728<\/p>\n<h1>\u30c6\u30b9\u30c8\u3057\u3066\u307f\u308b<\/h1>\n<p>\u3067\u306f\u3001\u5b9f\u969b\u306b\u30c6\u30b9\u30c8\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<br \/>\n\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067\u30a2\u30d7\u30ea\u3092\u8d77\u52d5\u3057\u307e\u3059\u3002<\/p>\n<pre><strong>php artisan native:serve\r\n<\/strong><\/pre>\n<p>\u3046\u307e\u304f\u8d77\u52d5\u3067\u304d\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-11919\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2023\/08\/native_php_5.png\" alt=\"\" width=\"640\" height=\"343\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2023\/08\/native_php_5.png 640w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2023\/08\/native_php_5-300x161.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>\u306f\u3044\u2757<br \/>\n\u3046\u307e\u304f\u30c7\u30b9\u30af\u30c8\u30c3\u30d7\u30a2\u30d7\u30ea\u306e\u30a6\u30a3\u30f3\u30c9\u30a6\u304c\u8868\u793a\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n<p>\u3067\u306f\u3001\u300c<strong>\u30e1\u30e2\u3092\u8ffd\u52a0\u3059\u308b<\/strong>\u300d\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u3069\u3046\u306a\u308b\u3067\u3057\u3087\u3046\u304b\u30fb\u30fb\u30fb\u30fb\u30fb\u30fb<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11920\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2023\/08\/native_php_6.png\" alt=\"\" width=\"640\" height=\"343\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2023\/08\/native_php_6.png 640w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2023\/08\/native_php_6-300x161.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/p>\n<p>\u306f\u3044\u2757<br \/>\n\u3061\u3087\u3063\u3068\u308f\u304b\u308a\u306b\u304f\u3067\u3059\u3051\u3069\u3001\u5165\u529b\u30d5\u30a9\u30fc\u30e0\u304c\u8868\u793a\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n<p>\u3067\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5165\u529b\u3057\u3066\u9001\u4fe1\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11921\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2023\/08\/native_php_7.png\" alt=\"\" width=\"637\" height=\"338\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2023\/08\/native_php_7.png 637w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2023\/08\/native_php_7-300x159.png 300w\" sizes=\"auto, (max-width: 637px) 100vw, 637px\" \/><\/p>\n<p>\u3046\u307e\u304f\u3044\u304f\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-11922\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2023\/08\/native_php_8.png\" alt=\"\" width=\"506\" height=\"294\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2023\/08\/native_php_8.png 506w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2023\/08\/native_php_8-300x174.png 300w\" sizes=\"auto, (max-width: 506px) 100vw, 506px\" \/><\/p>\n<p>\u306f\u3044\u2757<br \/>\n\u3046\u307e\u304f\u4fdd\u5b58\u3055\u308c\u3001\u8868\u793a\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n<p>\u6210\u529f\u3067\u3059\ud83d\ude0a<\/p>\n<p>\u3067\u306f\u3001\u305b\u3063\u304b\u304f\u30c7\u30b9\u30af\u30c8\u30c3\u30d7\u306a\u306e\u3067<strong>\u30d3\u30eb\u30c9\u3057\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u304d\u308b\u30d1\u30c3\u30b1\u30fc\u30b8\u306b\u5909\u63db<\/strong>\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<pre><strong>php artisan native:build linux\r\n<\/strong><\/pre>\n<p>\u203b \u306a\u304a\u3001<code>linux<\/code>\u306e\u90e8\u5206\u306f<code>mac<\/code>\u3082\u3057\u304f\u306f<code>windows<\/code>\u3067\u3082<code>OK<\/code>\u3067\u3059\u3002<\/p>\n<p>\u3059\u308b\u3068\u3001\u5c11\u3057\u6642\u9593\u306f\u304b\u304b\u308a\u307e\u3057\u305f\u304c\u30fb\u30fb\u30fb\u30fb\u30fb\u30fb<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11923\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2023\/08\/native_php_9.png\" alt=\"\" width=\"520\" height=\"304\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2023\/08\/native_php_9.png 520w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2023\/08\/native_php_9-300x175.png 300w\" sizes=\"auto, (max-width: 520px) 100vw, 520px\" \/><\/p>\n<p>\u306f\u3044\u2757<br \/>\n<code>Linux<\/code>\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u30d5\u30a1\u30a4\u30eb\u306e<code>.deb<\/code>\u30d5\u30a1\u30a4\u30eb\u304c<code>dist<\/code>\u30d5\u30a9\u30eb\u30c0\u306e\u4e2d\u306b\u4f5c\u6210\u3055\u308c\u3066\u3044\u307e\u3059\u3002\uff08\u30d5\u30a1\u30a4\u30eb\u30b5\u30a4\u30ba\u306f\u3001<code>79 MB<\/code>\u3067\u3057\u305f\uff09<\/p>\n<p>\u3067\u306f\u3001\u3053\u308c\u3092\u4f7f\u3063\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11924\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2023\/08\/native_php_10.png\" alt=\"\" width=\"640\" height=\"435\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2023\/08\/native_php_10.png 640w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2023\/08\/native_php_10-300x204.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/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-11925\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2023\/08\/native_php_11.png\" alt=\"\" width=\"376\" height=\"220\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2023\/08\/native_php_11.png 376w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2023\/08\/native_php_11-300x176.png 300w\" sizes=\"auto, (max-width: 376px) 100vw, 376px\" \/><\/p>\n<p>\u306f\u3044\u2757<br \/>\n\u30c7\u30b9\u30af\u30c8\u30c3\u30d7\u4e0a\u306b\u30a2\u30d7\u30ea\u304c\u767b\u9332\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n<p>\u3082\u3061\u308d\u3093\u52d5\u304d\u3082\u540c\u3058\u3067\u3001\u3055\u3089\u306b<code>DB<\/code>\u306f\u307e\u3063\u3055\u3089\u306a\u72b6\u614b\u3067\u8d77\u52d5\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n<p>\u3059\u3079\u3066\u6210\u529f\u3067\u3059\ud83d\ude0a\u2728<\/p>\n<h1>\u4f01\u696d\u69d8\u3078\u306e\u3054\u63d0\u6848<\/h1>\n<p><code>NativePHP<\/code>\u306f\u307e\u3060\u30a2\u30eb\u30d5\u30a1\u7248\u306a\u306e\u3067\u88fd\u54c1\u3068\u3057\u3066\u5229\u7528\u3059\u308b\u306b\u306f\u3082\u3046\u5c11\u3057\u6642\u9593\u304c\u304b\u304b\u308b\u72b6\u614b\u3067\u306f\u3042\u308a\u307e\u3059\u304c\u3001\u3068\u3066\u3082\u4fbf\u5229\u306b\u611f\u3058\u307e\u3057\u305f\u3002<\/p>\n<p>\u3057\u304b\u3082\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30e1\u30ea\u30c3\u30c8\u3082\u3042\u308a\u307e\u3059\u3002<\/p>\n<ul>\n<li>Laravel\uff08PHP\uff09\u306e\u6280\u8853\u3092\u4f7f\u3046\u3053\u3068\u304c\u3067\u304d\u308b<\/li>\n<li>Vue\u3084React\u306a\u3069\u597d\u304d\u306a\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u306e\u6280\u8853\u3092\u305d\u306e\u307e\u307e\u4f7f\u3048\u308b<\/li>\n<li>\u30b3\u30fc\u30c9\u3092\u3072\u3068\u3064\u4f5c\u308c\u3070 mac \u3084 windows \u3060\u3051\u3067\u306a\u304f linux \u306b\u307e\u3067\u5bfe\u5fdc\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u308b<\/li>\n<\/ul>\n<p>\u3064\u307e\u308a\u3001\u5c02\u7528\u306e\u65b0\u3057\u3044\u6280\u8853\u3092\u5b66\u3076\u5fc5\u8981\u304c\u306a\u3044\u305f\u3081\u3001\u5b66\u7fd2\u30b3\u30b9\u30c8\u304c\u307b\u3068\u3093\u3069\u7121\u304f\u3001\u3055\u3089\u306b\u30af\u30ed\u30b9\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u306b\u5bfe\u5fdc\u3057\u3066\u3044\u308b\u306e\u3067\u8ab0\u306b\u3067\u3082\u914d\u5e03\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3068\u3044\u3046\u30b9\u30b0\u30ec\u30e2\u30ce\u306a\u8a33\u3067\u3059\u3002<\/p>\n<p>\u3082\u3057\u3053\u3046\u3044\u3063\u305f\u3054\u5e0c\u671b\u3092\u304a\u6301\u3061\u3067\u3057\u305f\u3089\u3001\u3044\u3064\u3067\u3082\u304a\u6c17\u8efd\u306b\u304a\u554f\u3044\u5408\u308f\u305b\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u304a\u5f85\u3061\u3057\u3066\u304a\u308a\u307e\u3059\u3002\ud83d\ude0a\u2728<\/p>\n<h1>\u304a\u308f\u308a\u306b<\/h1>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u8a18\u5ff5\u3059\u3079\u304d<code>500<\/code>\u8a18\u4e8b\u76ee\uff08\u672c\u5f53\u306f\u30b9\u30c8\u30c3\u30af\u304c\u3042\u308b\u306e\u3067<code>501<\/code>\u8a18\u4e8b\u76ee\u306a\u3093\u3067\u3059\u3051\u3069\u306d\u2026\ud83d\ude05\uff09\u306f<code>NativePHP<\/code>\u3092\u304a\u5c4a\u3051\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u307e\u3060\u307e\u3060\u30a2\u30eb\u30d5\u30a1\u7248\u306a\u306e\u3067\u3001\u4eca\u5f8c\u3069\u3046\u306a\u308b\u304b\u306f\u308f\u304b\u308a\u307e\u305b\u3093\u304c\u3053\u3053\u307e\u3067\u306e\u5b8c\u6210\u5ea6\u306a\u3089\u304d\u3063\u3068\u6b63\u5f0f\u7248\u307e\u3067\u884c\u304f\u3068\u601d\u3044\u307e\u3059\u3057\u3001<code>Electron<\/code>\u3084<code>tauri<\/code>\u306b\u5909\u308f\u308b\u30c7\u30b9\u30af\u30c8\u30c3\u30d7\u30a2\u30d7\u30ea\u958b\u767a\u306e\u65b0\u3057\u3044\u9053\u306b\u306a\u308b\u53ef\u80fd\u6027\u3082\u3042\u308b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u305c\u3072\u7686\u3055\u3093\u3082\u697d\u3057\u3093\u3067\u3084\u3063\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u306d\u3002<\/p>\n<p>\u3067\u306f\u3067\u306f\u301c\u2757<\/p>\n<p style=\"text-align: center;\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4328 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/no_3.png\" alt=\"\" width=\"364\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/no_3.png 364w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/no_3-300x264.png 300w\" sizes=\"auto, (max-width: 364px) 100vw, 364px\" \/>\u300c\u795e\u69d8\u306b\u5acc\u308f\u308c\u3066\u3044\u308b\u306e\u304b\u3001<br \/>\n\u795e\u793e\u306b\u884c\u3063\u305f\u3042\u3068\u306f<br \/>\n\u5fc5\u305a\u5acc\u306a\u3053\u3068\u304c\u8d77\u3053\u308a\u307e\u3059\u2026\u306a\u305c\ud83d\ude2d\u300d<\/p>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u3010\u7686\u3055\u3093\u3078\u306e\u304a\u793c\uff1a500\u8a18\u4e8b\u9054\u6210\u3057\u307e\u3057\u305f\u2757\u3011 \u4eca\u56de\u306e\u8a18\u4e8b\u3067\u306a\u3093\u3068500\u8a18\u4e8b\u306b\u306a\u308a\u307e\u3059\u3002 \u524d\u56de\u306e400\u8a18\u4e8b\u304c\u300c2021\u5e7410\u670818\u65e5\u516c\u958b\u300d\u3060\u3063\u305f\u306e\u3067\u30011\u5e749\u30f6\u6708\u307b &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.capilano-fw.com\/?p=11911\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;NativePHP \u3067\u7c21\u5358\u306a\u30e1\u30e2\u5e33\u30a2\u30d7\u30ea\u3064\u304f\u3063\u3066\u307f\u305f&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":11930,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-11911","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\/11911","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=11911"}],"version-history":[{"count":6,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/11911\/revisions"}],"predecessor-version":[{"id":11929,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/11911\/revisions\/11929"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/media\/11930"}],"wp:attachment":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=11911"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=11911"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=11911"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}