public function authenticate()
{
$id = $this->getPayload()->get('sub');
if (! $this->auth->byId($id))
{
return false;
}
return $this->user();
}
protected function authenticated(Request $request, $user)
{
$credentials = $request->only('email', 'password');
try {
if (! $token = JWTAuth::attempt($credentials)) {
echo "Invalid request!";
}
} catch (JWTException $e) {
echo "Could not create a token!";
}
\Cookie::queue('token', $token, 3600);
}
When printing $id
it return to the id of user's table let say i don't have id I used user_id
how can i change this and where please guide. Thanks