0

When I try to login, I get this error

ErrorException in ActivationRepository.php line 41: Undefined variable: table

but user get logged successfully, this was working fine before, can you please look at this, what could be the issue?

Any help would be highly appreciated.

5
  • 1
    Can you provide full code? Commented Apr 28, 2017 at 5:52
  • Please Provide your code Commented Apr 28, 2017 at 5:52
  • Which code you need,i am using basic scaffolding for authentication. @DharmeshRakholia Commented Apr 28, 2017 at 5:53
  • ActivationRepository class code Commented Apr 28, 2017 at 5:54
  • Here is the code kopy.io/dupRE,look at line 41 and 42 Commented Apr 28, 2017 at 6:00

2 Answers 2

2

Well,you need to modify your ActivationRepository class.

Change this

private function regenerateToken($user)
    {
        $token = $this->getToken();
        $this->db->table($table)->where('user_id', $user->id)->update([
            'token' => $token,
            'created_at' => new Carbon()
        ]);
        return $token;
    }

To

private function regenerateToken($user)
    {
        $token = $this->getToken();
        // $this->table refers to 'user_activations',btw you can pass table name manually although not recommended.
        $this->db->table($this->table)->where('user_id', $user->id)->update([
            'token' => $token,
            'created_at' => new Carbon()
        ]);
        return $token;
    }

Hope this helps.

Sign up to request clarification or add additional context in comments.

Comments

0

Create ActivationFactory.php

Steps

mkdir app/Factories

code

rote.php

Route::get('user/activation/{token}', 'Auth\AuthController@activateUser')->name('user.activate');

ActivationFactory.php

Add here Your codes

Please Check This link For Example

http://jimfrenette.com/2016/07/laravel-user-registration-with-email-activation/

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.