The refresh token generated by Laravel Passport is indeed an opaque token, which means it is just a random string and does not contain any meaningful information. The refresh token is not directly stored in the oauth_refresh_tokens table. Instead, only the hashed version of the refresh token is stored in the oauth_refresh_tokens table.
To obtain the refresh token ID from a refresh token, you can use the find method provided by the RefreshTokenRepository class. Here's an example of how you can do it:
use Laravel\Passport\RefreshTokenRepository;
// Assuming you have the refresh token stored in a variable called $refreshToken
$refreshTokenRepository = new RefreshTokenRepository();
$refreshTokenId = $refreshTokenRepository->find($refreshToken)->id;
// Now you have the refresh token ID and can use it to look it up in the DB
Make sure to include the necessary use statement for the RefreshTokenRepository class at the top of your file.
Note that the find method will return null if the refresh token is not found in the database.