Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Doctrine Extensions

Doctrine Extensions Laravel Package

oro/doctrine-extensions

Adds extra Doctrine DQL functions and field types for MySQL and PostgreSQL (e.g., DATE/TIME, TIMESTAMPDIFF, CONVERT_TZ, DAY/WEEK/MONTH, MD5). Includes registration examples for common frameworks and guidance for extending platforms/functions.

View on GitHub
Deep Wiki
Context7

Cross database doctrine DQL functions for MySQL and PostgreSQL.

Frequently asked questions about Doctrine Extensions
What is oro/doctrine-extensions?
oro/doctrine-extensions is a Composer package that adds cross-database Doctrine DQL functions and field types for MySQL and PostgreSQL. It lets Doctrine ORM queries use functions such as DATE, TIMESTAMPDIFF, CONVERT_TZ, WEEK, and MD5 without raw SQL. In Laravel, it is relevant only when your app uses Doctrine ORM rather than Eloquent alone.
How do I install oro/doctrine-extensions in a Laravel project?
Install it with Composer using composer require oro/doctrine-extensions. Choose the package branch that matches your Doctrine ORM version, such as ^3.0 for Doctrine ORM 3 and ^2.0 for Doctrine 2.x. Laravel does not include Doctrine ORM by default, so you also need doctrine/orm and a working Doctrine integration in the app.
Is oro/doctrine-extensions compatible with Laravel?
It is not a native Eloquent package, but it can work in Laravel apps that use Doctrine ORM. Laravel supports Doctrine through doctrine/orm and doctrine/dbal, and custom DQL functions can be registered in the Doctrine configuration. You will need to adapt the Symfony or standalone registration examples from the README to your Laravel Doctrine setup.
How do I register oro/doctrine-extensions DQL functions in Laravel Doctrine?
Register the package's DQL function classes with your Doctrine Configuration or EntityManager, mapping names like DATE, TIMESTAMPDIFF, and CONVERT_TZ to the provided classes. If you use a Doctrine bundle-style config in Laravel, adapt the README YAML examples into that config. Then clear caches and verify the functions in a Doctrine QueryBuilder query.
Which databases does oro/doctrine-extensions support?
The package explicitly targets MySQL and PostgreSQL for its DQL functions and field types. Other databases such as SQLite or SQL Server would need custom platform implementations. Confirm your production database before adopting functions that rely on MySQL or PostgreSQL behavior.
Can I use oro/doctrine-extensions with Laravel Eloquent?
No, the package extends Doctrine ORM DQL, not Eloquent's query builder. Eloquent does not support custom Doctrine DQL functions out of the box, so you would need raw SQL, custom grammar extensions, or Doctrine QueryBuilder for these functions. Use it only in parts of a Laravel app that already run through Doctrine.
What DQL functions does oro/doctrine-extensions provide?
It provides date and time helpers such as DATE, TIME, TIMESTAMP, TIMESTAMPDIFF, CONVERT_TZ, DAY, WEEK, MONTH, QUARTER, HOUR, MINUTE, and SECOND. It also includes MD5 and other functions such as DAYOFWEEK, DAYOFMONTH, and DAYOFYEAR. These functions map DQL expressions to database-specific SQL for MySQL and PostgreSQL.
Does oro/doctrine-extensions support Doctrine ORM 3?
Yes, the package has a 3.x branch intended for Doctrine ORM 3, while Doctrine 2.x users should use the 2.x branch. Check your installed Doctrine ORM version before requiring the package. If you upgrade Doctrine, retest queries that use custom DQL functions because function registration APIs and behavior can change.
What are MoneyType and PercentType in oro/doctrine-extensions?
MoneyType and PercentType are Doctrine field types included with the package for financial and percentage values. They require custom Doctrine entity mappings and are not native Eloquent column types. In Laravel, use them only if you are mapping Doctrine entities and need those semantics; otherwise decimal columns may be simpler.
Is oro/doctrine-extensions maintained and safe for production?
The package is maintained under the oroinc GitHub organization and includes CI, but you should review its release history and branch compatibility before production use. Benchmark query-heavy or transformation functions on production-scale data. Also test all queries against your exact MySQL or PostgreSQL version and Doctrine ORM version.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo
bernskioldmedia/laravel-harvest
bernskiold/laravel-data-scrubber
bernskiold/laravel-currency-converter
bernskiold/laravel-campaign-monitor
bernskioldmedia/laravel-autotranslate
siberfx/telegram-bot
roy-sandip/laravel-view-extended
gregsphotography/site-builder-core
roy-sandip/laravel-view
anodyne/blade-fluentui-icons
webx-ui/module-catalog-collections