Commit cc6dd6cb authored by Jens Segers's avatar Jens Segers

Revert MongoId::isValid() and use L5.1

parent 4cdb4fba
{ {
"name": "jenssegers/mongodb", "name": "jenssegers/mongodb",
"description": "A MongoDB based Eloquent model and Query builder for Laravel 4", "description": "A MongoDB based Eloquent model and Query builder for Laravel",
"keywords": ["laravel","eloquent","mongodb","mongo","database","model"], "keywords": ["laravel","eloquent","mongodb","mongo","database","model"],
"homepage": "https://github.com/jenssegers/laravel-mongodb", "homepage": "https://github.com/jenssegers/laravel-mongodb",
"authors": [ "authors": [
...@@ -11,14 +11,14 @@ ...@@ -11,14 +11,14 @@
], ],
"license" : "MIT", "license" : "MIT",
"require": { "require": {
"illuminate/support": "^5.1", "illuminate/support": "~5.1.0",
"illuminate/container": "^5.1", "illuminate/container": "~5.1.0",
"illuminate/database": "^5.1", "illuminate/database": "~5.1.0",
"illuminate/events": "^5.1" "illuminate/events": "~5.1.0"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "^4.0|^5.0", "phpunit/phpunit": "^4.0|^5.0",
"orchestra/testbench": "^3.1", "orchestra/testbench": "~3.1.0",
"mockery/mockery": "^0.9", "mockery/mockery": "^0.9",
"satooshi/php-coveralls": "^0.6" "satooshi/php-coveralls": "^0.6"
}, },
......
...@@ -790,7 +790,7 @@ class Builder extends BaseBuilder { ...@@ -790,7 +790,7 @@ class Builder extends BaseBuilder {
*/ */
public function convertKey($id) public function convertKey($id)
{ {
if (MongoId::isValid($id)) if (is_string($id) and strlen($id) === 24 and ctype_xdigit($id))
{ {
return new MongoId($id); return new MongoId($id);
} }
......
<?php require 'vendor/autoload.php';
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment