Question

After following the steps for the 4.1.26 upgrade on Laravel, when I try to re-migrate and re-seed the database, I am presented with Laravel Unknown formatter "prefix" error.

I add the nullable string to the User's migration file and the three functions to the User's model.

$table->string('remember_token', 100)->nullable();

and

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

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

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

Looking at PHP Artisan, it rolls back the migrations, migrates them all, it's when it moves onto the seeding of the database.

I know it's the update as when I go back to a previous version, it's all working correct.

Was it helpful?

Solution 2

The error turns out was from the seeding of the users table. For some obscure reason, the faker data, was trying to reference a prefix instead of a title.

OTHER TIPS

Upgrading To 4.1.26 From <= 4.1.25 Laravel 4.1.26 introduces security improvements for "remember me" cookies. Before this update, if a remember cookie was hijacked by another malicious user, the cookie would remain valid for a long period of time, even after the true owner of the account reset their password, logged out, etc. This change requires the addition of a new remember_token column to your users (or equivalent) database table. After this change, a fresh token will be assigned to the user each time they login to your application. The token will also be refreshed when the user logs out of the application. The implications of this change are: if a "remember me" cookie is hijacked, simply logging out of the application will invalidate the cookie.

http://laravel.com/docs/upgrade#upgrade-4.1.26

https://laracasts.com/lessons/laravel-updating-to-4-1-26

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top