4.2. 编辑个人资料
编辑个人资料
接下来我们将一起开发用户编辑资料的功能,用户可以编辑自己的资料,并查看结果。
新增字段
查看用户表相关的迁移文件:
database/migrations/2014_10_12_000000_create_users_table.php
.
.
.
public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->string('email')->unique();
$table->timestamp('email_verified_at')->nullable();
$table->string('password');
$table->rememberToken();
$table->timestamps();
});
}
.
.
.
以上是 users
表里的所有字段,作为 个人中心页面,可以看出我们还缺少『头像』和『个人简介』字段: