Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

How to validate mongoDB id? #2484

Unanswered
MunirBash asked this question in Q&A
Discussion options

Im trying to validate the mongoDB id (coming in from API request) but I cant find a function from this library to do the ID validation.
I tried using this https://www.php.net/manual/en/mongodb-bson-objectid.tostring.php but latest Laravel Sails doesnt seem to have this extension.

You must be logged in to vote

Replies: 1 comment

Comment options

@MunirBash There is no need to use ObjectID to verify that the ID is valid,You can use validation rules like alpha|size:24

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
Converted from issue

This discussion was converted from issue #2447 on December 17, 2022 18:10.

AltStyle によって変換されたページ (->オリジナル) /