HI
in a project i need to login from manager to user with user_id for more support my users. in older versions i try to to this as below function:
public function admin_login(Request $request) {
$user_id = $request->only('user_id');
$token = auth()->tokenById($user_id);
return response()->json(new UserResource(Auth::user()), Response::HTTP_OK)->header('Authorization', $token);
}
that are for laravue 0.6.3 version but after update to version 0.13.2 with laravel sanctum this not work. i try the other way but failed. i hope somebody help for this.
HI in a project i need to login from manager to user with user_id for more support my users. in older versions i try to to this as below function:
that are for laravue 0.6.3 version but after update to version 0.13.2 with laravel sanctum this not work. i try the other way but failed. i hope somebody help for this.
tanks.