0

I'm working on one project, where I have to make "Remember Me" on authentication, but I have one problem. The company uses "users" table for users, and "login" table for remember token, IP address and login date.

I have found that if I want to have "Remember Me" on authentication, I have "remember_token" in my "users" table. But can I have the "remember_token" in another table and connect it by some relations?

1 Answers1

0

You can add a new migration that can add a new field to users table: php artisan make:migration add_remember_token_field_to_users_table This will create a migration for table users, then add this code:

    public function up()
    {
        Schema::table('users', function (Blueprint $table) {
            $table->rememberToken();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('users', function (Blueprint $table) {
            $table->dropColumn('remember_token');
        });
    }