Open
Description
- Laravel-mongodb Version: 5.3 and above
- PHP Version: 8.2 and above
- Database Driver & Version: mongodb
Description: When we installing passport with mongodb, the _id is storing as string
Steps to reproduce
- Install laravel 12 and mongodb 5.3 and above and install laravel-passport
- After configuring the passport try to add same requests at a time to generate access_token
- follow mongodb laravel-passport setup doc : https://www.mongodb.com/docs/drivers/php/laravel-mongodb/current/user-authentication/#laravel-passport
Expected behaviour
{
"_id" : ObjectId("67af1b54cab5260f0e02c45e"),
"id" : "2d5975c24790106151a359b50cd65e8df24d667c45198c9543d8a730d4f3b2a3acbd5e6ac9b9de3b",
"user_id" : "5fd345d8881f551ed73033a2",
"client_id" : "678f73cda02347dc38027792",
"scopes" : "[]",
"revoked" : false,
"created_at" : ISODate("2025-02-14T10:30:44.163+0000"),
"updated_at" : ISODate("2025-02-14T10:30:44.198+0000"),
"expires_at" : ISODate("2025-08-14T10:30:44.163+0000"),
"name" : "example-token"
}
Actual behaviour
{
"_id" : "2d5975c24790106151a359b50cd65e8df24d667c45198c9543d8a730d4f3b2a3acbd5e6ac9b9de3b",
"user_id" : "5fd345d8881f551ed73033a2",
"client_id" : "678f73cda02347dc38027792",
"scopes" : "[]",
"revoked" : false,
"created_at" : ISODate("2025-02-14T10:30:44.163+0000"),
"updated_at" : ISODate("2025-02-14T10:30:44.198+0000"),
"expires_at" : ISODate("2025-08-14T10:30:44.163+0000"),
"name" : "example-token"
}