{"id":1405,"date":"2020-11-25T21:17:27","date_gmt":"2020-11-25T12:17:27","guid":{"rendered":"https:\/\/www.wetch.co.jp\/?p=1405"},"modified":"2022-01-25T22:37:07","modified_gmt":"2022-01-25T13:37:07","slug":"laravel%e5%ad%a6%e7%bf%92%e4%b8%ad%e3%81%a7%e3%81%99%e3%83%bb%e3%83%bb%e3%83%bb","status":"publish","type":"post","link":"https:\/\/www.wetch.co.jp\/note\/laravel%e5%ad%a6%e7%bf%92%e4%b8%ad%e3%81%a7%e3%81%99%e3%83%bb%e3%83%bb%e3%83%bb\/","title":{"rendered":"Laravel\u5b66\u7fd2\u4e2d\u3067\u3059\u30fb\u30fb\u30fb"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u6848\u4ef6\u3067Laravel\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u306b\u306a\u308a\u3001\u30ed\u30fc\u30ab\u30eb\u74b0\u5883\u3067\u52d5\u304b\u3057\u306a\u304c\u3089\u5b66\u7fd2\u3057\u3066\u304a\u308a\u307e\u3059\u30fb\u30fb\u30fb\u3002<br>\u4eca\u306e\u3068\u3053\u308d\u89e6\u3063\u3066\u307f\u3066\u3001\u4ee5\u4e0b\u306e\u70b9\u304c\u30d3\u30c3\u30af\u30ea\u30dd\u30a4\u30f3\u30c8\u3067\u3057\u305f\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u25efartisan\u30b3\u30de\u30f3\u30c9\u304c\u3059\u3054\u304f\u591a\u5f69<br>\u30b3\u30de\u30f3\u30c9\u4e00\u767a\u3067\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u306e\u53ef\u8996\u5316\u3084\u3001\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u306e\u5b9f\u884c\u3001Seeder\u306e\u6295\u5165\u7b49\u3001Model,Controller,migration\u306e\u30b9\u30b1\u30eb\u30c8\u30f3\u307e\u3067\u4f5c\u3063\u3066\u304f\u308c\u3061\u3083\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u25ef\u30b3\u30de\u30f3\u30c9\u304c\u3068\u3066\u3082\u30b9\u30de\u30fc\u30c8\u306a\u5370\u8c61<br>\u4f8b\u3048\u3070\u4ee5\u4e0b\u3001\u6614\u3005\uff08\u4eca\u3082\u3084\u308a\u307e\u3059\u304c\uff09DB\u306e\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u6210\u3059\u308b\u5834\u5408\u306b<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>CREATE TABLE USERS\n    ( id int, name varchar(10), mail_address varchar(10), tel  varchar(11), address01 varchar(30),  address02 varchar(30) )\nCHARACTER SET utf8 COLLATE utf8_general_ci;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u3068SQL\u3092\u3064\u3089\u3064\u3089\u3068\u6253\u3064\u306e\u306b\u6bd4\u3079\u3066\u3001migration\u30d5\u30a1\u30a4\u30eb\u306b\u4f8b\u3048\u3070\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8a18\u8f09\u3057\u3066\u304a\u3044\u3066<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>public function up() {\n    Schema::create('users', function (Blueprint $table) {\n        $table->bigIncrements('id');\n        $table->string('name')->comment('\u304a\u540d\u524d');\n        $table->string('mail_address')->comment('\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9');\n        $table->string('tel')->comment('\u96fb\u8a71\u756a\u53f7');\n        $table->string('address01')->comment('\u4f4f\u624001');\n        $table->string('address02')->comment('\u4f4f\u624002');\n\n        $table->timestamps();\n    });\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u30b3\u30de\u30f3\u30c9\u4e00\u767a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>php artisan migrate<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u3067\u30c6\u30fc\u30d6\u30eb\u304c\u3067\u304d\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u30c6\u30fc\u30d6\u30eb\u306e\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3059\u308b\u3068\u304d\u3082\u3001\u6614\u3005\uff08\u3057\u3064\u3053\u3044\u3067\u3059\u304c\u3001\u4eca\u3082\u3084\u308a\u307e\u3059\u304c\uff09\u3060\u3068<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SELECT * FROM USERS WHERE ADDRESS01 = '\u6771\u4eac\u90fd' ORDER BY ID ASC;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u305d\u308c\u304c\u3001Model\u306b\u5b9a\u7fa9\u3057\u3066\u3044\u308b\u5185\u5bb9\u304b\u3089Controller\u3067\u30c7\u30fc\u30bf\u53d6\u5f97\u3059\u308b\u5834\u5408<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$users = User::where('address01', '\u6771\u4eac\u90fd')\n             ->orderBy('id', 'asc')\n             ->get()->toArray();<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u3067\u7d50\u679c\u304c\u914d\u5217\u3067\u53d6\u5f97\u3067\u304d\u3066\u3057\u307e\u3044\u307e\u3059\u3002Eloquent\u30e2\u30c7\u30eb\u306e\u53d6\u5f97\u306f\u30b9\u30de\u30fc\u30c8\u306a\u5370\u8c61\u3092\u53d7\u3051\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u307e\u3060\u307e\u3060\u5e8f\u306e\u53e3\u3067\u3044\u308d\u3044\u308d\u3042\u308a\u305d\u3046\u3067\u3059\u304c\u3001\u5b9f\u52d9\u3067\u7406\u89e3\u3092\u6df1\u3081\u3066\u3044\u304d\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6848\u4ef6\u3067Laravel\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u306b\u306a\u308a\u3001\u30ed\u30fc\u30ab\u30eb\u74b0\u5883\u3067\u52d5\u304b\u3057\u306a\u304c\u3089\u5b66\u7fd2\u3057\u3066\u304a\u308a\u307e\u3059\u30fb\u30fb\u30fb\u3002\u4eca\u306e\u3068\u3053\u308d\u89e6\u3063\u3066\u307f\u3066\u3001\u4ee5\u4e0b\u306e\u70b9\u304c\u30d3\u30c3\u30af\u30ea\u30dd\u30a4\u30f3\u30c8\u3067\u3057\u305f\u3002 \u25efartisan\u30b3\u30de\u30f3\u30c9\u304c\u3059\u3054\u304f\u591a\u5f69\u30b3\u30de\u30f3\u30c9\u4e00\u767a\u3067\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u306e\u53ef\u8996\u5316 [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":1414,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_wp_rev_ctl_limit":""},"categories":[210],"tags":[],"class_list":["post-1405","post","type-post","status-publish","format-standard","has-post-thumbnail","category-210"],"_links":{"self":[{"href":"https:\/\/www.wetch.co.jp\/note\/wp-json\/wp\/v2\/posts\/1405","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wetch.co.jp\/note\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wetch.co.jp\/note\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wetch.co.jp\/note\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wetch.co.jp\/note\/wp-json\/wp\/v2\/comments?post=1405"}],"version-history":[{"count":0,"href":"https:\/\/www.wetch.co.jp\/note\/wp-json\/wp\/v2\/posts\/1405\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wetch.co.jp\/note\/wp-json\/wp\/v2\/media\/1414"}],"wp:attachment":[{"href":"https:\/\/www.wetch.co.jp\/note\/wp-json\/wp\/v2\/media?parent=1405"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wetch.co.jp\/note\/wp-json\/wp\/v2\/categories?post=1405"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wetch.co.jp\/note\/wp-json\/wp\/v2\/tags?post=1405"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}