Last active
August 29, 2015 13:59
-
-
Save denvers/10828426 to your computer and use it in GitHub Desktop.
Laravel upgrade to 4.1.26
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Illuminate\Database\Schema\Blueprint; | |
use Illuminate\Database\Migrations\Migration; | |
class AddNullableRememberTokenToUser extends Migration { | |
/** | |
* Run the migrations. | |
* | |
* @return void | |
*/ | |
public function up() | |
{ | |
Schema::table('users', function($table) { | |
$table->text("remember_token")->nullable(); | |
}); | |
} | |
/** | |
* Reverse the migrations. | |
* | |
* @return void | |
*/ | |
public function down() | |
{ | |
Schema::table('users', function($table) { | |
$table->dropColumn("remember_token"); | |
}); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Illuminate\Auth\UserInterface; | |
use Illuminate\Auth\Reminders\RemindableInterface; | |
use \Eloquent; | |
class User extends Eloquent implements UserInterface, RemindableInterface | |
{ | |
/** | |
* The database table used by the model. | |
* | |
* @var string | |
*/ | |
protected $table = 'users'; | |
/** | |
* The attributes excluded from the model's JSON form. | |
* | |
* @var array | |
*/ | |
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; | |
} | |
// Added for Laravel 4.1.26 upgrade | |
public function getRememberToken() | |
{ | |
return $this->remember_token; | |
} | |
public function setRememberToken($value) | |
{ | |
$this->remember_token = $value; | |
} | |
public function getRememberTokenName() | |
{ | |
return 'remember_token'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Code changes based on documentation at http://laravel.com/docs/upgrade