首先,我运行以下命令。
php artisan make:model member -m
之后,它创建一个成员,然后运行:
php artisan migrate
它成功迁移,但是没有在数据库中创建成员表。
迁移
class CreateMembersTable extends Migration
{
public function up()
{
Schema::create('members', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('fullname');
$table->string('email');
$table->string('password');
$table->timestamps();
});
}
public function down()
{
Schema::dropIfExists('members');
}
}