【发布时间】:2014-12-07 08:59:17
【问题描述】:
在 Lynda 教程“使用 Laravel 启动并运行”中,创建了一个示例应用 (authapp),允许用户登录。
这里是 create_user 迁移的结构:
public function up()
{
Schema::create('users', function($newtable)
{
$newtable->increments('id');
$newtable->string('email')->unique();
$newtable->string('username',100)->unique();
$newtable->string('password',50);
$newtable->string('remember_token',100);
$newtable->timestamps();
});
}
这里是对应的视图文件摘录:
{{ Form::open(array('url'=>'register')) }}
{{ Form::label('email', 'Email Address') }}
{{ Form::text('email') }}
{{ Form::label('username', 'Username') }}
{{ Form::text('username') }}
{{ Form::label('password', 'Password') }}
{{ Form::password('password') }}
{{ Form::submit('Sign Up')}}
{{ Form::close() }}
保存所有内容并尝试在实际应用中注册时,出现错误:教程说这是因为没有为remember_token 变量设置默认值,并建议去 phpMyAdmin 设置默认值为 NULL。
但是,当我这样做时,我收到以下错误消息:
因此,我无法修复错误并继续。
你知道如何处理这种情况吗?
【问题讨论】:
标签: mysql laravel phpmyadmin