wooserv/php-objectid
Generate and work with MongoDB-style ObjectId values in PHP. Create new ObjectIds, parse and validate existing ones, convert to hex strings, and access parts like timestamp for sorting or debugging. Lightweight utility with no database required.
Fast, lightweight MongoDB-style ObjectId generator for PHP.
composer require wooserv/php-objectid
use WooServ\ObjectId\ObjectId;
$id = ObjectId::generate();
if (ObjectId::isValid($id)) {
echo "Timestamp: " . date('Y-m-d H:i:s', ObjectId::getTimestamp($id));
}
composer test
MIT © WooServ
How can I help you explore Laravel packages today?