Argument 2 missing for Illuminate \ Database \ Eloquent \ Model :: setAttribute () Laravel 4.1

Update:

I have a problem with my logout action when I was working in Laravel 4, it works with fin, but in laravel 4.1 I have this error:

Missing argument 2 for Illuminate\Database\Eloquent\Model::setAttribute(), called in C:\Users\mohammed\workspace\mylittlebiz\vendor\laravel\framework\src\Illuminate\Database\Eloquent\Model.php on line 2432 and defined 

this is my action:

 public function doLogout() { Auth::logout(); // log the user out of our application return Redirect::to('login'); // redirect the user to the login screen } 

this is my model:

 use Illuminate\Auth\UserInterface; use Illuminate\Auth\Reminders\RemindableInterface; class User extends Eloquent implements UserInterface, RemindableInterface { /** * The database table used by the model. * * @var string */ protected $table = 'users'; protected $hidden = array('password'); /** * Get the unique identifier for the user. * * @return mixed */ public function getAuthIdentifier() { return $this->getKey(); } /** * Get the password for the user. * * @return string */ public function getAuthPassword() { return $this->password; } /** * Get the e-mail address where password reminders are sent. * * @return string */ public function getReminderEmail() { return $this->email; } /* overriding actions from abstact class*/ public function getRememberToken(){} public function setRememberToken($value){} public function getRememberTokenName(){} 
+6
source share
1 answer

I had exactly the same problem ...

Try updating your methods in the Users model as follows:

 public function getRememberToken() { return $this->remember_token; } public function setRememberToken($value) { $this->remember_token = $value; } public function getRememberTokenName() { return 'remember_token'; } 

You can also take a look at:

http://laravel.com/docs/upgrade

Philipp

+11
source

All Articles