-
Notifications
You must be signed in to change notification settings - Fork 1.5k
DOCSP-36631: laravel feature compatibility #2802
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,331 @@ | ||
.. _laravel-feature-compat: | ||
|
||
============================= | ||
Laravel Feature Compatibility | ||
============================= | ||
|
||
.. facet:: | ||
:name: genre | ||
:values: reference | ||
|
||
.. meta:: | ||
:keywords: php framework, odm, support | ||
|
||
.. contents:: On this page | ||
:local: | ||
:backlinks: none | ||
:depth: 2 | ||
:class: singlecol | ||
|
||
Overview | ||
-------- | ||
|
||
This guide describes the Laravel features that are supported by | ||
the {+odm-long+}. This page discusses Laravel version 11.x feature | ||
availability in the {+odm-short+}. | ||
|
||
The following sections contain tables that describe whether individual | ||
features are available in {+odm-short+}. | ||
|
||
Database Features | ||
----------------- | ||
|
||
.. list-table:: | ||
:header-rows: 1 | ||
|
||
* - Eloquent Feature | ||
- Availability | ||
|
||
* - Configuration | ||
- ✓ | ||
|
||
* - Read/Write Connections | ||
- Use :manual:`read preference </core/read-preference/>` instead. | ||
|
||
* - Multiple Database Connections | ||
- ✓ | ||
|
||
* - Listening for Query Events | ||
- ✓ | ||
|
||
* - Monitoring Cumulative Query Time | ||
- ✓ | ||
|
||
* - Transactions | ||
- ✓ See :ref:`laravel-transactions`. | ||
|
||
* - Command Line Interface (CLI) | ||
- Use the :mdb-shell:`MongoDB Shell <>` (``mongosh``). | ||
|
||
* - Database Inspection | ||
- *Unsupported* | ||
|
||
* - Database Monitoring | ||
- *Unsupported* | ||
|
||
.. TODO Listening to query events: yes (to be checked) | ||
.. TODO Monitoring cumulative query time: yes (to be checked) | ||
rustagir marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Query Features | ||
-------------- | ||
|
||
The following Eloquent methods are not supported in {+odm-short+}: | ||
|
||
- ``toSql()`` | ||
- ``toRawSql()`` | ||
- ``whereColumn()`` | ||
- ``orWhereColumn()`` | ||
- ``whereFulltext()`` | ||
- ``groupByRaw()`` | ||
- ``orderByRaw()`` | ||
- ``inRandomOrder()`` | ||
- ``union()`` | ||
- ``unionAll()`` | ||
- ``havingRaw()`` | ||
- ``having()`` | ||
- ``havingBetween()`` | ||
- ``orHavingRaw()`` | ||
- ``whereIntegerInRaw()`` | ||
- ``orWhereIntegerInRaw()`` | ||
- ``whereIntegerNotInRaw()`` | ||
- ``orWhereIntegerNotInRaw()`` | ||
|
||
.. list-table:: | ||
:header-rows: 1 | ||
|
||
* - Eloquent Feature | ||
- Availability | ||
|
||
* - Running Queries | ||
- ✓ | ||
|
||
* - Chunking Results | ||
- ✓ | ||
|
||
* - Aggregates | ||
- ✓ | ||
|
||
* - Select Statements | ||
- ✓ | ||
|
||
* - Raw Expressions | ||
- *Unsupported* | ||
|
||
* - Joins | ||
- *Unsupported* | ||
|
||
* - Unions | ||
- *Unsupported* | ||
|
||
* - `Basic Where Clauses <https://laravel.com/docs/11.x/queries#basic-where-clauses>`__ | ||
- ✓ | ||
|
||
* - `Additional Where Clauses <https://laravel.com/docs/11.x/queries#additional-where-clauses>`__ | ||
- ✓ | ||
|
||
* - Logical Grouping | ||
- ✓ | ||
|
||
* - `Advanced Where Clauses <https://laravel.com/docs/11.x/queries#advanced-where-clauses>`__ | ||
- ✓ | ||
|
||
* - `Subquery Where Clauses <https://laravel.com/docs/11.x/queries#subquery-where-clauses>`__ | ||
- *Unsupported* | ||
|
||
* - Ordering | ||
- ✓ | ||
|
||
* - Random Ordering | ||
- *Unsupported* | ||
|
||
* - Grouping | ||
- Partially supported, use :ref:`Aggregation Builders <laravel-query-builder>`. | ||
rustagir marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
* - Limit and Offset | ||
- ✓ | ||
|
||
* - Conditional Clauses | ||
- ✓ | ||
|
||
* - Insert Statements | ||
- ✓ | ||
|
||
* - Auto-Incrementing IDs | ||
- *Unsupported as MongoDB uses ObjectIDs* | ||
|
||
* - Upserts | ||
- *Unsupported* | ||
|
||
* - Update Statements | ||
- ✓ | ||
|
||
* - Updating JSON Columns | ||
- *Unsupported* | ||
|
||
* - Increment and Decrement Values | ||
- ✓ | ||
|
||
* - Debugging | ||
- ✓ | ||
|
||
.. TODO Streaming Results Lazily: (to be checked) | ||
.. TODO JSON Where Clauses: (to be checked) | ||
.. TODO Full Text Where Clauses: to be checked | ||
.. TODO Pessimistic Locking: (to be checked) | ||
|
||
Pagination Features | ||
------------------- | ||
|
||
{+odm-short+} supports all Laravel pagination features. | ||
|
||
|
||
Migration Features | ||
------------------ | ||
|
||
{+odm-short+} supports all Laravel migration features, but the | ||
implementation is specific to MongoDB's schemaless model. | ||
|
||
Seeding Features | ||
---------------- | ||
|
||
{+odm-short+} supports all Laravel seeding features. | ||
|
||
Eloquent Features | ||
----------------- | ||
|
||
.. list-table:: | ||
:header-rows: 1 | ||
|
||
* - Eloquent Feature | ||
- Availability | ||
|
||
* - Models | ||
- ✓ | ||
|
||
* - UUID and ULID Keys | ||
- ✓ | ||
|
||
* - Timestamps | ||
- ✓ | ||
|
||
* - Retrieving Models | ||
- ✓ | ||
|
||
* - Advanced Subqueries | ||
- *Unsupported* | ||
|
||
* - Retrieving or Creating Models | ||
- ✓ | ||
|
||
* - Retrieving Aggregates | ||
- *Partially supported* | ||
|
||
* - Inserting and Updating Models | ||
- ✓ | ||
|
||
* - Upserts | ||
- *Unsupported, but you can use the createOneOrFirst() method* | ||
|
||
* - Deleting Models | ||
- ✓ | ||
|
||
* - Soft Deleting | ||
- ✓ | ||
|
||
* - Pruning Models | ||
- ✓ | ||
|
||
.. tip:: | ||
|
||
To learn more, see the :ref:`laravel-eloquent-model-class` guide. | ||
|
||
.. TODO Replicating Models: to be checked | ||
.. TODO Query Scopes: to be checked | ||
.. TODO Comparing Models: to be checked | ||
.. TODO Events: to be checked | ||
.. TODO Using Closures: to be checked | ||
.. TODO Observers: to be checked | ||
.. TODO Muting Events: to be checked | ||
|
||
Eloquent Relationship Features | ||
------------------------------ | ||
|
||
.. list-table:: | ||
:header-rows: 1 | ||
|
||
* - Eloquent Feature | ||
- Availability | ||
|
||
* - Defining Relationships | ||
- ✓ | ||
|
||
* - Many-to-Many Relationships | ||
- ✓ | ||
|
||
* - Polymorphic Relationships | ||
- ✓ | ||
|
||
* - Dynamic Relationships | ||
- ✓ | ||
|
||
* - Querying Relations | ||
- ✓ | ||
|
||
* - Aggregating Related Models | ||
- *Unsupported* | ||
|
||
* - Inserting and Updating Related Models | ||
- ✓ | ||
|
||
.. tip:: | ||
|
||
To learn more, see the :ref:`laravel-eloquent-model-relationships` guide. | ||
|
||
.. TODO Eager Loading: to be checked | ||
.. TODO Touching Parent Timestamps: to be checked | ||
|
||
Eloquent Collection Features | ||
---------------------------- | ||
|
||
{+odm-short+} supports all Eloquent collection features. | ||
|
||
Eloquent Mutator Features | ||
------------------------- | ||
|
||
.. list-table:: | ||
:header-rows: 1 | ||
|
||
* - Eloquent Feature | ||
- Availability | ||
|
||
* - Casts | ||
- ✓ | ||
|
||
* - Array and JSON Casting | ||
- ✓ You can store objects and arrays in MongoDB without serializing to JSON. | ||
|
||
* - Date Casting | ||
- ✓ | ||
|
||
* - Enum Casting | ||
- ✓ | ||
|
||
* - Encrypted Casting | ||
- ✓ | ||
|
||
* - Custom Casts | ||
- ✓ | ||
|
||
.. tip:: | ||
|
||
To learn more, see the :ref:`laravel-eloquent-model-class` guide. | ||
|
||
.. TODO Query Time Casting: to be checked | ||
|
||
.. TODO Eloquent Resource Features | ||
.. TODO Eloquent Serialization Features | ||
|
||
Eloquent Model Factory Features | ||
------------------------------- | ||
|
||
{+odm-short+} supports all Eloquent factory features. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.