我是laravel的新手。所以这将是一个非常基本的问题。我的问题是迁移中的列类型应该是什么,以创建出生日期列。例如,我创建了一个用于献血的迁移文件,其中列是这样的,
$table->increments('id');
$table->unsignedInteger('donner_id');
$table->foreign('donner_id')->references->('id')->on('users')->onDelete('cascade')->onUpdate('cascade');
$table->string('name');
$table->string('email')->unique();
$table->string('blood_group');
$table->string('phone_number')->unique();
$table->string('location');
$table-> ------('date_of_birth');
$table->timestamps();
你可以看到laravel4迁移使用'string'类型而不是'varchar'。那么laravel 4中出生日期列的类型应该是什么?
Date would be the most suitable
$table->date('date_of_birth');