Laravel Passport Authentication, How to return token for user?

The client send id to server and server finds this user in database and returns UserModel. How to return token for this UserModel using Laravel Passport? I tried this way: $user = User::find($id)->first(); $credentials = [“login” => $user->login, “password” => $user->password]; if (auth()->attempt($credentials)) { $token = auth()->user()->createToken(‘TutsForWeb’)->accessToken; }