{"id":49,"date":"2024-10-11T15:26:12","date_gmt":"2024-10-11T06:26:12","guid":{"rendered":"https:\/\/laravel.satoshis.jp\/?p=49"},"modified":"2024-10-11T15:39:19","modified_gmt":"2024-10-11T06:39:19","slug":"laravel%e3%81%a7%e3%83%9a%e3%83%bc%e3%82%b8%e3%82%92%e4%bd%9c%e3%81%a3%e3%81%a6%e3%81%bf%e3%82%88%e3%81%86","status":"publish","type":"post","link":"https:\/\/laravel.satoshis.jp\/?p=49","title":{"rendered":"Laravel\u3067\u30da\u30fc\u30b8\u3092\u4f5c\u3063\u3066\u307f\u3088\u3046"},"content":{"rendered":"<h4>Hello World\u30da\u30fc\u30b8\u306e\u4f5c\u6210<\/h4>\n<p>\u30b3\u30de\u30f3\u30c9\u30d7\u30ed\u30f3\u30d7\u30c8\u3067\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\nphp artisan \u30b3\u30de\u30f3\u30c9\u3067\u4f7f\u7528\u3067\u304d\u308b\u591a\u304f\u306e\u6a5f\u80fd\u304c\u30ea\u30b9\u30c8\u30a2\u30c3\u30d7\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n&gt; php artisan\r\n<\/pre>\n<p>\u3053\u306e\u4e2d\u306b\u3042\u308b make:view \u3092\u4f7f\u3063\u3066\u30da\u30fc\u30b8\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n&gt; php artisan make:view hello\r\n<\/pre>\n<p>VSCode\u3092\u898b\u308b\u3068\u3001resources\/views\u306e\u4e0b\u306b hello.blade.php \u304c\u4f5c\u3089\u308c\u3066\u3044\u307e\u3059\u3002<br \/>\nhello.blade.php \u306b h1\u30bf\u30b0\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: xml; highlight: [2]; title: ; notranslate\" title=\"\">\r\n&lt;div&gt;\r\n    &lt;h1&gt;Hello World!&lt;\/h1&gt;\r\n    &lt;!-- Always remember that you are absolutely unique. Just like everyone else. - Margaret Mead --&gt;\r\n&lt;\/div&gt;\r\n<\/pre>\n<p>routes\/web.php \u306b\u3001hello.blade.php \u3092\u8868\u793a\u3059\u308b\u305f\u3081\u306e\u8a2d\u5b9a\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: php; highlight: [8,9,10]; title: ; notranslate\" title=\"\">\r\n&lt;?php\r\n\r\nuse Illuminate\\Support\\Facades\\Route;\r\n\r\nRoute::get(&#039;\/&#039;, function () {\r\n    return view(&#039;welcome&#039;);\r\n});\r\nRoute::get(&#039;\/hello&#039;, function () {\r\n    return view(&#039;hello&#039;);\r\n});\r\n<\/pre>\n<p><a href=\"8000\/hello\" target=\"_blank\" rel=\"noopener\">localhost:8000\/hello<\/a>\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3068\u3001\u4f5c\u6210\u3057\u305f\u30da\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n<h4>Controller\u3092\u7d4c\u7531\u3057\u3066\u30da\u30fc\u30b8\u3092\u8868\u793a\u3059\u308b<\/h4>\n<p>\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067IndexController.php\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n&gt; php artisan make:controller IndexController\r\n<\/pre>\n<p>IndexController.php\u306f\u4ee5\u4e0b\u306e\u5185\u5bb9\u306b\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n&lt;?php\r\n\r\nnamespace App\\Http\\Controllers;\r\n\r\nuse Illuminate\\Http\\Request;\r\n\r\nclass IndexController extends Controller\r\n{\r\n    public function index()\r\n    {\r\n        return view(&#039;hello&#039;);\r\n    }\r\n}\r\n<\/pre>\n<p>routes\/web.php \u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: php; highlight: [11]; title: ; notranslate\" title=\"\">\r\n&lt;?php\r\n\r\nuse Illuminate\\Support\\Facades\\Route;\r\n\r\nRoute::get(&#039;\/&#039;, function () {\r\n    return view(&#039;welcome&#039;);\r\n});\r\nRoute::get(&#039;\/hello&#039;, function () {\r\n    return view(&#039;hello&#039;);\r\n});\r\nRoute::get(&#039;\/hello2&#039;, &#039;App\\Http\\Controllers\\IndexController@index&#039;);\r\n<\/pre>\n<p>\u3053\u308c\u3067\u3001\/hello2 \u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066\u3082 hello.blade.php \u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello World\u30da\u30fc\u30b8\u306e\u4f5c\u6210 \u30b3\u30de\u30f3\u30c9\u30d7\u30ed\u30f3\u30d7\u30c8\u3067\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 php artisan \u30b3\u30de\u30f3\u30c9\u3067\u4f7f\u7528\u3067\u304d\u308b\u591a\u304f\u306e\u6a5f\u80fd\u304c\u30ea\u30b9\u30c8\u30a2\u30c3\u30d7\u3055\u308c\u307e\u3059\u3002 &gt; php artis &#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-49","post","type-post","status-publish","format-standard","hentry","category-basics"],"_links":{"self":[{"href":"https:\/\/laravel.satoshis.jp\/index.php?rest_route=\/wp\/v2\/posts\/49","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/laravel.satoshis.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/laravel.satoshis.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/laravel.satoshis.jp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/laravel.satoshis.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=49"}],"version-history":[{"count":6,"href":"https:\/\/laravel.satoshis.jp\/index.php?rest_route=\/wp\/v2\/posts\/49\/revisions"}],"predecessor-version":[{"id":55,"href":"https:\/\/laravel.satoshis.jp\/index.php?rest_route=\/wp\/v2\/posts\/49\/revisions\/55"}],"wp:attachment":[{"href":"https:\/\/laravel.satoshis.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=49"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/laravel.satoshis.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=49"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/laravel.satoshis.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=49"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}