{"id":8771,"date":"2020-05-15T10:00:02","date_gmt":"2020-05-15T01:00:02","guid":{"rendered":"https:\/\/www.gigas-jp.com\/appnews\/?p=8771"},"modified":"2020-05-14T14:01:16","modified_gmt":"2020-05-14T05:01:16","slug":"laravel-%e3%83%87%e3%83%bc%e3%82%bf%e3%83%99%e3%83%bc%e3%82%b9%e3%83%9e%e3%82%a4%e3%82%b0%e3%83%ac%e3%83%bc%e3%82%b7%e3%83%a7%e3%83%b3","status":"publish","type":"post","link":"https:\/\/www.gigas-jp.com\/appnews\/archives\/8771","title":{"rendered":"[Laravel] \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3"},"content":{"rendered":"\n<p>Laravel\u306e\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u6a5f\u80fd\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u30c6\u30fc\u30d6\u30eb\u69cb\u9020\u306e\u53cd\u6620\u3092\u30b9\u30af\u30ea\u30d7\u30c8\u3068\u3057\u3066\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u3067\u5b9f\u884c\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u306b\u306a\u308a\u3001\u4fdd\u5b88\u3084\u5909\u66f4\u4f5c\u696d\u306a\u3069\u304c\u7c21\u5358\u306b\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<!--more-->\n\n\n\n<h4>\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u306e\u4f5c\u6210\u65b9\u6cd5<\/h4>\n\n\n\n<p>\u4f8b\u3068\u3057\u3066\u300cstudents\u300d\u30c6\u30fc\u30d6\u30eb\u306e\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u6210\u3057\u305f\u3044\u5834\u5408\u3092\u8aac\u660e\u3057\u307e\u3059\u3002<br> \u30b3\u30de\u30f3\u30c9\u30d7\u30ed\u30f3\u30d7\u30c8\u3067\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>php artisan make:migration create_students_table\nCreated Migration: 2020_05_15_000000_create_students_table_create_students_table<\/code><\/pre>\n\n\n\n<p>\u4e0a\u8a18\u30b3\u30de\u30f3\u30c9\u306e\u5b9f\u884c\u304c\u5b8c\u4e86\u3059\u308b\u3068\u3001<br> \/database\/migrations\u3000\u306b\u300c2020_05_15_000000_create_students_table.php\u300d\u3000\u304c\u751f\u6210\u3055\u308c\u307e\u3059\u3002(\u300c2020_05_15_000000\u300d\u306e\u90e8\u5206\u306f\u5b9f\u884c\u3057\u305f\u65e5\u4ed8\u3068\u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7\u306b\u306a\u308a\u307e\u3059\u306e\u3067\u3001\u5b9f\u884c\u65e5\u6642\u306b\u3088\u3063\u3066\u5909\u5316\u3057\u307e\u3059\u3002)<br><br> \u81ea\u52d5\u751f\u6210\u3055\u308c\u305f\u30b3\u30fc\u30c9\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\n\nuse Illuminate\\Support\\Facades\\Schema;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migrations\\Migration;\n\nclass CreateStudentsTable extends Migration\n{\n    \/**\n     * Run the migrations.\n     *\n     * @return void\n     *\/\n    public function up()\n    {\n        Schema::create('students', function (Blueprint $table) {\n            $table->bigIncrements('id');\n            $table->timestamps();\n        });\n    }\n\n    \/**\n     * Reverse the migrations.\n     *\n     * @return void\n     *\/\n    public function down()\n    {\n        Schema::dropIfExists('students');\n    }\n}<\/code><\/pre>\n\n\n\n<p>\u4e0a\u8a18\u306e\u81ea\u52d5\u751f\u6210\u30b3\u30fc\u30c9\u5185\u306eup\u30d5\u30a1\u30f3\u30af\u30b7\u30e7\u30f3&gt;create\u30e1\u30bd\u30c3\u30c9\u306b\u4f5c\u6210\u3057\u305f\u3044\u30c6\u30fc\u30d6\u30eb\u69cb\u9020\u306b\u3042\u308f\u305b\u305f\u51e6\u7406\u306e\u8a18\u8ff0\u3092\u304a\u3053\u306a\u3046\u3053\u3068\u306b\u3088\u308a\u3001students\u30c6\u30fc\u30d6\u30eb\u306e\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002<br> <br>\u4eca\u56de\u306f\u4f8b\u3068\u3057\u3066\u3001\u751f\u5f92\u60c5\u5831\u306e\u4fdd\u5b58\u7528\u30c6\u30fc\u30d6\u30eb\u306e\u4f5c\u6210\u3092\u304a\u3053\u306a\u3044\u307e\u3059\u306e\u3067\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8a18\u8ff0\u3092\u304a\u3053\u306a\u3044\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$table->bigIncrements('id');\n$table->string('name');\n$table->string('email');\n$table->string('phone');\n$table->timestamps();<\/code><\/pre>\n\n\n\n<p>\u4e0a\u8a181\u884c\u76ee\u306ebigIncrements\u306f\u81ea\u52d5\u63a1\u756a(auto increment)\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002<br> 5\u884c\u76ee\u306etimestamps\u306b\u3088\u308a\u300ccreated_at\u300d\uff08\u30ec\u30b3\u30fc\u30c9\u3092\u4f5c\u6210\u3057\u305f\u65e5\u6642\uff09\u3068\u300cupdated_at\u300d\uff08\u30ec\u30b3\u30fc\u30c9\u3092\u66f4\u65b0\u3057\u305f\u65e5\u6642\uff09\u306e2\u30ab\u30e9\u30e0\u306e\u81ea\u52d5\u751f\u6210\u304c\u304a\u3053\u306a\u308f\u308c\u307e\u3059\u3002\u30ec\u30b3\u30fc\u30c9\u306e\u8ffd\u52a0\u6642\u3084\u66f4\u65b0\u6642\u306b\u306fLaravel\u306b\u3088\u3063\u3066\u81ea\u52d5\u7684\u306b\u65e5\u6642\u304c\u4fdd\u5b58\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<h4>\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u306e\u5b9f\u884c<\/h4>\n\n\n\n<p>\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3067\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>php artisan migrate\nMigrating: 2020_05_15_000000_create_students_table\nMigrated:  2020_05_15_000000_create_students_table (0.31 seconds)<\/code><\/pre>\n\n\n\n<p><br>\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u30ed\u30fc\u30eb\u30d0\u30c3\u30af(\u6700\u5f8c\u306b\u5b9f\u884c\u3057\u305f\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3092\u53d6\u308a\u6d88\u3059)\u3057\u305f\u3044\u5834\u5408\u306f\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>migrate:rollback<\/code><\/pre>\n\n\n\n<p><br>\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u306e\u5b9f\u884c\u5f8c\u3001PhpMyAdmin\u306a\u3069\u3067\u78ba\u8a8d\u3092\u304a\u3053\u306a\u3046\u3068\u3001\u8a72\u5f53\u306e\u30c6\u30fc\u30d6\u30eb\u304c\u751f\u6210\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u304c\u78ba\u8a8d\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" width=\"435\" height=\"221\" src=\"\/appnews\/wp-content\/uploads\/sites\/4\/2020\/05\/phpmy.png\" alt=\"\" class=\"wp-image-8781\"\/><\/figure>\n\n\n\n<p>\u3053\u306e\u6642\u70b9\u3067\u306f\u30c6\u30fc\u30d6\u30eb\u306b\u306f\u30ec\u30b3\u30fc\u30c9\u304c\u5165\u3063\u3066\u3044\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<p>\u521d\u671f\u30c7\u30fc\u30bf\u306e\u6295\u5165\u3092\u304a\u3053\u306a\u3046\u305f\u3081\u306b\u3001Laravel\u3067\u306f\u300c\u30b7\u30fc\u30c0\u30fc\u300d(Seeder)\u3068\u547c\u3070\u308c\u308b\u6a5f\u80fd\u304c\u3042\u308a\u307e\u3059\u3002\u6b21\u56de\u306f\u300c\u30b7\u30fc\u30c0\u30fc\u300d(Seeder)\u306e\u4f7f\u7528\u65b9\u6cd5\u306e\u7d39\u4ecb\u3092\u304a\u3053\u306a\u3044\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p><br>\u91d1\u66dc\u65e5\u62c5\u5f53:nishida<\/p>\n<div class='wp_social_bookmarking_light'>\n            <div class=\"wsbl_google_plus_one\"><g:plusone size=\"medium\" annotation=\"none\" href=\"https:\/\/www.gigas-jp.com\/appnews\/archives\/8771\" ><\/g:plusone><\/div>\n            <div class=\"wsbl_hatena_button\"><a href=\"\/\/b.hatena.ne.jp\/entry\/https:\/\/www.gigas-jp.com\/appnews\/archives\/8771\" class=\"hatena-bookmark-button\" data-hatena-bookmark-title=\"[Laravel] \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\" data-hatena-bookmark-layout=\"standard\" title=\"\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u3092\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af\u306b\u8ffd\u52a0\"> <img src=\"\/\/b.hatena.ne.jp\/images\/entry-button\/button-only@2x.png\" alt=\"\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u3092\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af\u306b\u8ffd\u52a0\" width=\"20\" height=\"20\" style=\"border: none;\" \/><\/a><script type=\"text\/javascript\" src=\"\/\/b.hatena.ne.jp\/js\/bookmark_button.js\" charset=\"utf-8\" async=\"async\"><\/script><\/div>\n            <div class=\"wsbl_twitter\"><a href=\"https:\/\/twitter.com\/share\" class=\"twitter-share-button\" data-url=\"https:\/\/www.gigas-jp.com\/appnews\/archives\/8771\" data-text=\"[Laravel] \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\" data-via=\"GIGASJAPAN_APPS\" data-lang=\"ja\">Tweet<\/a><\/div>\n            <div class=\"wsbl_facebook_like\"><div id=\"fb-root\"><\/div><fb:like href=\"https:\/\/www.gigas-jp.com\/appnews\/archives\/8771\" layout=\"button_count\" action=\"like\" width=\"100\" share=\"false\" show_faces=\"false\" ><\/fb:like><\/div>\n            <div class=\"wsbl_facebook_send\"><div id=\"fb-root\"><\/div><fb:send href=\"https:\/\/www.gigas-jp.com\/appnews\/archives\/8771\" colorscheme=\"light\" ><\/fb:send><\/div>\n    <\/div>\n<br class='wp_social_bookmarking_light_clear' \/>\n","protected":false},"excerpt":{"rendered":"<p>Laravel\u306e\u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u6a5f\u80fd\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u30c6\u30fc\u30d6\u30eb\u69cb\u9020\u306e\u53cd\u6620\u3092\u30b9\u30af\u30ea\u30d7\u30c8\u3068\u3057\u3066\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u3067\u5b9f\u884c\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u306b\u306a\u308a\u3001\u4fdd\u5b88\u3084\u5909\u66f4\u4f5c\u696d\u306a\u3069\u304c\u7c21\u5358\u306b\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n","protected":false},"author":16,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[100],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts\/8771"}],"collection":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/users\/16"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/comments?post=8771"}],"version-history":[{"count":14,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts\/8771\/revisions"}],"predecessor-version":[{"id":8790,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts\/8771\/revisions\/8790"}],"wp:attachment":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/media?parent=8771"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/categories?post=8771"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/tags?post=8771"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}