Support the ongoing development of Laravel.io →
posted 9 years ago
Database
Last updated 2 years ago.
0

Did you add remember_token varchar(255) Null to your users database table? Did you add the three functions in your User model?

public function getRememberToken()
{
    return $this->remember_token;
}

public function setRememberToken($value)
{
    $this->remember_token = $value;
}

public function getRememberTokenName()
{
    return 'remember_token';
}
Last updated 2 years ago.
0

swgj19 said:

Did you add remember_token varchar(255) Null to your users database table? Did you add the three functions in your User model?

public function getRememberToken()
{
   return $this->remember_token;
}

public function setRememberToken($value)
{
   $this->remember_token = $value;
}

public function getRememberTokenName()
{
   return 'remember_token';
}

the user model looks same but i dont think so for the database table, I just add this

$table->rememberToken();

to my database model (since I saw that code from the documentation), and I put that code like this one

Schema::create('users', function(Blueprint $table)
		{
			$table->rememberToken();
			$table->increments('id');
			$table->string('username');
			$table->string('email');
			$table->string('password');
			$table->string('first_name');
			$table->string('last_name');
			$table->timestamps();
		});

but the code still error

how can I implement your code into mine? oh! one more thing, do I have to use seed or migrate command again to reset the database

Last updated 2 years ago.
0
Solution

You are simply missing an "_"

remember_token

http://laravel.com/docs/upgrade

To rollback all migrations and reset again:

php artisan migrate:refresh

php artisan migrate:refresh --seed
Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

dzulfikar dzulfikar Joined 24 Jun 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.