-1

I want to create and store a verify token in the database to activate the user's account after registration. But I'm getting the above error. Can you help please.

Users Table

       Schema::create('users', function (Blueprint $table) {
        $table->increments('id');
        $table->string('name');
        $table->string('email')->unique();
        $table->string('phone',10)->unique();
        $table->string('password');
        $table->string('verifyToten');
        $table->boolean('is_active')->default(0);
        $table->timestamp('email_verified_at')->nullable();
        $table->rememberToken();
        $table->timestamps();
    });

User model

   protected $fillable = [
    'name', 'email', 'phone', 'password','verifyToten'
];

Register Controller

        return User::create([
        'name' => $data['name'],
        'email' => $data['email'],
        'phone' => $data['phone'],
        'password' => bcrypt($data['password']),
        'verify_token' => Str::random(40),
    ]);
Shamima Saleem
  • 143
  • 1
  • 1
  • 9

1 Answers1

0

in your user migration your field name is $table->string('verifyToten'); while in your register controller you are saving value for 'verify_token' => Str::random(40) change verify_token to verifyToten in your controller

Salman Zafar
  • 3,844
  • 5
  • 20
  • 43