Builder
Builder copied to clipboard
Starter user registration is broken
when user clicks on activation link, laravel does not activate account and instead asks them to resend activation email..
Solution:
change UserService
Do not return $userMeta->user()->first()
as this will return the first user in the db
Instead
`public function findByActivationToken($token) { $userMeta = $this->userMeta->where('activation_token', $token)->first();
if ($userMeta) {
return $userMeta->user();
}
return false;
}
`
I should probably fork and submit PRs instead :)
Actually the fix is in app/Models/UserMeta.php
public function user()
{
return User::where('id', $this->user_id)->first();
}
should be
public function user()
{
return $this->belongsTo(User::class);
}