php artisan make:mode hoge opiton と打つようです。
[vagrant@localhost myblog]$ php artisan make:model Post –migration
Model created successfully.
Created Migration: 2018_09_08_222520_create_posts_table
なんじゃこりゃー 全く覚えてないぞ。。
migration fileが作られる。
root -> database -> migration

migration file
upがこのmigrationで行いたい処理、downが巻き戻したい時
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreatePostsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('posts', function (Blueprint $table) {
$table->increments('id');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('posts');
}
}
timestampはcreated at and updated atを管理する。